server

package
v0.0.0-...-5eaa115 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 2, 2018 License: Apache-2.0 Imports: 22 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GenerateObjectKey

func GenerateObjectKey(S3Prefix, S3TrailingPrefix string, t time.Time) string

format is S3_PREFIX/S3_TRAILING_PREFIX/date/hour/timestamp_uuid.log

func Get

func Get(w http.ResponseWriter, r *http.Request)

func GetSession

func GetSession(S3Region string) *session.Session

func PutLogBlobToS3

func PutLogBlobToS3(env *Env, body []byte, objectKey string) bool

Write blob to S3://S3_BUCKET/objectKey with timeout of S3_TIMEOUT

func Upload

func Upload(env *Env, body []byte) bool

collects log messages from fluent-bit and sends them to S3

Types

type Env

type Env struct {
	S3Region         string
	S3Bucket         string
	S3Prefix         string
	S3TrailingPrefix string
	S3Timeout        time.Duration
	S3Session        *session.Session
	S3Svc            s3iface.S3API
}

func (*Env) Post

func (env *Env) Post(w http.ResponseWriter, r *http.Request)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL