github.com/jasonkeene/cli@v6.14.1-0.20160816203908-ca5715166dfb+incompatible/cf/api/logs/logs_repository.go (about)

     1  package logs
     2  
     3  import "time"
     4  
     5  type Loggable interface {
     6  	ToLog(loc *time.Location) string
     7  	ToSimpleLog() string
     8  	GetSourceName() string
     9  }
    10  
    11  //go:generate counterfeiter . Repository
    12  
    13  type Repository interface {
    14  	RecentLogsFor(appGUID string) ([]Loggable, error)
    15  	TailLogsFor(appGUID string, onConnect func(), logChan chan<- Loggable, errChan chan<- error)
    16  	Close()
    17  }
    18  
    19  const defaultBufferTime time.Duration = 25 * time.Millisecond
    20  
    21  func max(a, b int) int {
    22  	if a > b {
    23  		return a
    24  	}
    25  	return b
    26  }