build: golang.org/x/build/maintner/maintnerd/gcslog Index | Files

package gcslog

import "golang.org/x/build/maintner/maintnerd/gcslog"

Package gcslog is an implementation of maintner.MutationSource and Logger for Google Cloud Storage.

Index

Package Files

gcslog.go

type GCSLog Uses

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

GCSLog logs mutations to GCS.

func NewGCSLog Uses

func NewGCSLog(ctx context.Context, bucketName string) (*GCSLog, error)

NewGCSLog creates a GCSLog that logs mutations to a given GCS bucket. If the bucket name contains a "/", the part after the slash will be a prefix for the segments.

func (*GCSLog) CopyFrom Uses

func (gl *GCSLog) CopyFrom(src maintner.MutationSource) error

CopyFrom is only used for the one-time migrate from disk-to-GCS code path.

func (*GCSLog) GetMutations Uses

func (gl *GCSLog) GetMutations(ctx context.Context) <-chan maintner.MutationStreamEvent

GetMutations returns a channel of mutations or related events. The channel will never be closed. All sends on the returned channel should select on the provided context.

func (*GCSLog) Log Uses

func (gl *GCSLog) Log(m *maintpb.Mutation) error

Log writes m to GCS after the buffer is full or after a periodic flush.

func (*GCSLog) RegisterHandlers Uses

func (gl *GCSLog) RegisterHandlers(mux *http.ServeMux)

RegisterHandlers adds handlers for the default paths (/logs and /logs/).

func (*GCSLog) SetDebug Uses

func (gl *GCSLog) SetDebug(v bool)

SetDebug controls whether verbose debugging is enabled on this log.

It must only be called before it's used.

Package gcslog imports 22 packages (graph) and is imported by 4 packages. Updated 2019-11-19. Refresh now. Tools for package owners.