Documentation ¶
Index ¶
- Constants
- Variables
- func GenerateMAC(appGUID, serviceInstanceGUID uuid.UUID, key string) (string, error)
- func NewSyslogDrainURL(baseURL, appID, instanceID, secretKey string) (*url.URL, error)
- func VerifyMAC(appGUID, serviceInstanceGUID uuid.UUID, key, unverifiedMAC string) (bool, error)
- type CloudfoundryLogPutter
- type Handler
- type Log
- type LogEvent
- type SplunkProvider
- func (s *SplunkProvider) Bind(ctx context.Context, bindData provideriface.BindData) (binding domain.Binding, err error)
- func (s *SplunkProvider) Deprovision(ctx context.Context, deprovisionData provideriface.DeprovisionData) (operationData string, isAsync bool, err error)
- func (s *SplunkProvider) LastOperation(ctx context.Context, lastOperationData provideriface.LastOperationData) (state domain.LastOperationState, description string, err error)
- func (s *SplunkProvider) Provision(ctx context.Context, provisionData provideriface.ProvisionData) (dashboardURL, operationData string, isAsync bool, err error)
- func (s *SplunkProvider) Unbind(ctx context.Context, unbindData provideriface.UnbindData) (domain.UnbindSpec, error)
- func (s *SplunkProvider) Update(ctx context.Context, updateData provideriface.UpdateData) (operationData string, isAsync bool, err error)
- type Stream
Constants ¶
View Source
const ( ParamMAC = "mac" ParamServiceInstanceID = "instance_id" )
View Source
const ( SyslogLogGroup = "rfc5424_syslog" SyslogOwner = "GOV.UK_PaaS" SyslogDataType = "DATA_MESSAGE" )
Variables ¶
View Source
var ( ErrUnauthenticatedRequest = fmt.Errorf("unauthenticated-request") ErrBadRequestBody = fmt.Errorf("failed-to-read-body") ErrBadRequestParams = fmt.Errorf("invalid-request-arguments") ErrFailForwardStream = fmt.Errorf("failed-to-forward-to-stream") )
View Source
var (
ErrInvalidMessageAuthArgs = errors.New("invalid arguments for mac generation")
)
View Source
var ErrUpdateNotSupported = errors.New("Updating a splunk service is currently not supported")
Functions ¶
func GenerateMAC ¶
GenerateMAC generates a base64 encoded Message Authentication Code for a given application GUID
func NewSyslogDrainURL ¶
Types ¶
type CloudfoundryLogPutter ¶
type CloudfoundryLogPutter interface {
PutCloudfoundryLog(log cloudfoundry.Log, logGroupName string) error
}
CloudfoundryLogPutter forwards cloudfoundry format Logs to stream
type Handler ¶
type Handler struct { // Stream is the log destination Stream CloudfoundryLogPutter // Secret is the shared secret for authenticating log requests Secret string }
type Log ¶
type Log struct { Owner string `json:"owner"` LogGroup string `json:"logGroup"` LogStream string `json:"logStream"` SubscriptionFilters []string `json:"subscriptionFilters"` MessageType string `json:"messageType"` LogEvents []LogEvent `json:"logEvents"` }
Log represents a collection of Log messages from the same source. It is a duplicate of the AWS Cloudwatch Log envelope.
type LogEvent ¶
type LogEvent struct { ID string `json:"id"` Timestamp int64 `json:"timestamp"` Message string `json:"message"` }
LogEvent represents a log message. It mirrors the format of the AWS Cloudwatch log event envelope
type SplunkProvider ¶
func NewSplunkProvider ¶
func NewSplunkProvider(drainURL, secretKey string) (*SplunkProvider, error)
func (*SplunkProvider) Bind ¶
func (s *SplunkProvider) Bind(ctx context.Context, bindData provideriface.BindData) (binding domain.Binding, err error)
func (*SplunkProvider) Deprovision ¶
func (s *SplunkProvider) Deprovision(ctx context.Context, deprovisionData provideriface.DeprovisionData) (operationData string, isAsync bool, err error)
func (*SplunkProvider) LastOperation ¶
func (s *SplunkProvider) LastOperation(ctx context.Context, lastOperationData provideriface.LastOperationData) (state domain.LastOperationState, description string, err error)
func (*SplunkProvider) Provision ¶
func (s *SplunkProvider) Provision(ctx context.Context, provisionData provideriface.ProvisionData) (dashboardURL, operationData string, isAsync bool, err error)
func (*SplunkProvider) Unbind ¶
func (s *SplunkProvider) Unbind(ctx context.Context, unbindData provideriface.UnbindData) (domain.UnbindSpec, error)
func (*SplunkProvider) Update ¶
func (s *SplunkProvider) Update(ctx context.Context, updateData provideriface.UpdateData) ( operationData string, isAsync bool, err error)
type Stream ¶
type Stream struct { // Name is the name of the kinesis stream to write to Name string // Client is the AWS SDK capable of PutRecord AWS sdk.Client }
Stream represents the input to the csls logging pipeline
func (*Stream) PutCloudfoundryLog ¶
func (w *Stream) PutCloudfoundryLog(log cloudfoundry.Log, groupName string) error
PutCloudfoundryLog transforms cloudfoundry format logs into csls format (cloudwatch format) logs and writes them to the csls kinesis stream with a given log group name
Click to show internal directories.
Click to hide internal directories.