storage

package module
v0.0.0-...-cd31f34 Latest Latest
Warning

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

Go to latest
Published: Jul 18, 2018 License: Apache-2.0 Imports: 6 Imported by: 0

README

This package holds GCS Utlities

logging package

You can create a time based file that rollovers after max age

tr := gcs.NewTimeRotator(
		context.Background(),
		"web-logs",
		"message-events",
		"2006/01/20060102-1504",
		uuid.NewV4().String(),
		15*time.Minute,
	)

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type TimeRotator

type TimeRotator struct {
	// contains filtered or unexported fields
}

TimeRotator stores relevant pointers to create and generator a writer

func NewGCSTimeRotator

func NewGCSTimeRotator(ctx context.Context, bkt string, path string, fileFmt string, uuid string, maxAge time.Duration) *TimeRotator

NewGCSTimeRotator returns a newly intitiated Writer

func (*TimeRotator) Close

func (bw *TimeRotator) Close() error

Close active blob

func (*TimeRotator) Write

func (bw *TimeRotator) Write(e []byte) (int, error)

Write adds the message to a queue to be written later

Jump to

Keyboard shortcuts

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