Documentation ¶
Index ¶
Constants ¶
const ( // DefaultLogSize is the maximum size bundle we will accept. If unaccepted, it // will return ErrBundleTooLarge to the grpc client. DefaultLogSize = 10 * 1024 * 1024 )
Variables ¶
var ErrFailedProcessing = errors.New("failed processing due to transient error; retrying")
ErrFailedProcessing indicates a failure in processing that can be retried
Functions ¶
This section is empty.
Types ¶
type Config ¶
type Config struct { IndexName string ListenAddress string SpoolDir string MaxLogSize uint64 ElasticSearch es.Config KVMember string Logger *logrus.Logger RateLimiting bool RateLimitConfig ratelimit.Config Processor func(file *FileMeta) error }
Config is the configuration of the server.
type FileMeta ¶
FileMeta is a simple struct for passing ip info with filenames... Private; mostly public for json serialization.
type LogPipe ¶
type LogPipe struct {
// contains filtered or unexported fields
}
LogPipe pipes data from protobuf-generated logs (see log/client.go for the client) to elasticsearch in a structured fashion. Logs are delivered as bundles, which are signed and tagged with a public key that corresponds to the client. Each bundle is stored locally and delivered to ES from disk.
func NewLogPipe ¶
NewLogPipe creates a LogPipe server.
func (*LogPipe) Boot ¶
Boot boots the service. It returns error if it cannot, or if there was an error that occurred while serving. This function will block until the server is stopped. It will close the `ready` channel you pass when ready to serve.
func (*LogPipe) Close ¶
Close closes the server. If a timeout is given, it will sleep for that long between shutting down grpc and closing the listener, allowing for cleanup to potentially occur.
func (*LogPipe) ListenAddr ¶
ListenAddr reports the listener address, especially for when binding to :0. returns an empty string if the listener is empty.
func (*LogPipe) ReceiveLogs ¶
func (lp *LogPipe) ReceiveLogs(lf log.LogPipe_ReceiveLogsServer) (retErr error)
ReceiveLogs receives the logs for processing. Spins out a goroutine to send to ES once received.