README

Go Reference

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

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

Documentation

Overview

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

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type GCSLog

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

GCSLog logs mutations to GCS.

func NewGCSLog

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

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

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

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

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

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

func (*GCSLog) SetDebug

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.

Source Files