gcs

package
v1.3.0 Latest Latest
Warning

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

Go to latest
Published: May 3, 2024 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrObjectNotFound = errors.New("object not found")
)

Functions

This section is empty.

Types

type Object

type Object struct {
	Key            string
	Generation     int64
	MetaGeneration int64
	ContentType    string
	Content        []byte
}

Object is a mock Server object.

type Server

type Server struct {
	BucketName string
	Objects    []*Object
	// contains filtered or unexported fields
}

Server is a simple Google Cloud Storage mock server. It serves the provided Objects for the BucketName on the HTTPAddress when Start or StartTLS is called. It provides primitive support "Generation Conditions" when Object contents are fetched. Ref: https://pkg.go.dev/cloud.google.com/go/storage#hdr-Conditions

func NewServer

func NewServer(bucketName string) *Server

func (*Server) HTTPAddress

func (s *Server) HTTPAddress() string

func (*Server) Start

func (s *Server) Start()

func (*Server) StartTLS

func (s *Server) StartTLS(config *tls.Config)

func (*Server) Stop

func (s *Server) Stop()

Jump to

Keyboard shortcuts

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