Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func BuildSelector ¶
func BuildSelector(v url.Values) ([]*loggregator_v2.Selector, error)
BuildSelector returns a slice of v2 loggregator Selectors generated from the given query parameters
func ReadHandler ¶
func ReadHandler( lp LogsProvider, heartbeat time.Duration, streamTimeout time.Duration, ) http.HandlerFunc
ReadHandler returns a http.Handler that will serve logs over server sent events. Logs are streamed from the logs provider and written to the client connection. The format of the envelopes is as follows:
data: <JSON ENVELOPE BATCH> data: <JSON ENVELOPE BATCH>
Types ¶
type CFAuthMiddlewareProvider ¶
type CFAuthMiddlewareProvider struct {
// contains filtered or unexported fields
}
CFAuthMiddlewareProvider defines middleware for authenticating CF clients
func NewCFAuthMiddlewareProvider ¶
func NewCFAuthMiddlewareProvider( oauth2Reader Oauth2ClientReader, logAuthorizer LogAuthorizer, ) CFAuthMiddlewareProvider
NewCFAuthMiddlewareProvider creates a CFAuthMiddlewareProvider
func (CFAuthMiddlewareProvider) Middleware ¶
func (m CFAuthMiddlewareProvider) Middleware(h http.Handler) http.Handler
Middleware provides an http.Handler for checking access to to logs
type Handler ¶
type Handler struct {
// contains filtered or unexported fields
}
Handler defines a struct for servering http endpoints
func NewHandler ¶
func NewHandler(lp LogsProvider, streamTimeout time.Duration) *Handler
NewHandler returns a configured HTTP Handler
type LogAuthorizer ¶
type LogAuthorizer interface { IsAuthorized(sourceID, token string) bool AvailableSourceIDs(token string) []string }
LogAuthorizer defines the interface for validating and providing access to logs
type LogsProvider ¶
type LogsProvider interface {
Stream(ctx context.Context, req *loggregator_v2.EgressBatchRequest) (Receiver, error)
}
LogsProvder defines the interface for opening streams to the logs provider
type Oauth2ClientReader ¶
type Oauth2ClientReader interface {
Read(token string) (auth.Oauth2Client, error)
}
Oauth2ClientReader defines the interface for retrieving an OAuth2 client
type Receiver ¶
type Receiver func() (*loggregator_v2.EnvelopeBatch, error)
Receiver defines a function for receiving batch envelopes