storage

package
v0.6.0 Latest Latest
Warning

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

Go to latest
Published: Mar 14, 2024 License: Apache-2.0 Imports: 19 Imported by: 0

Documentation

Index

Constants

View Source
const DefaultS3SourceAddress = "s3://minio:minio123@localhost:9000/walrus?sslmode=disable"

Variables

View Source
var ErrInvalidFormat = errors.New("invalid s3 credential format")

ErrInvalidFormat is returned when the provided s3 credential is not in the expected format.

Functions

func GetPlanFileName

func GetPlanFileName(run *model.ResourceRun) string

func IsConnected

func IsConnected(ctx context.Context) error

func Wait

func Wait(ctx context.Context, serverUrl string) (err error)

Types

type Config

type Config struct {
	Endpoint string
	// Default region will be us-east-1.
	// https://github.com/minio/minio-go/blob/e8ddcf0238962d766f44242b595511f4decd365c/api-put-bucket.go#L37.
	Region          string
	Bucket          string
	Secure          bool
	AccessKeyID     string
	SecretAccessKey string
}

Config contains all configuration necessary to connect to an s3 compatible server.

func NewConfig

func NewConfig(conf string) (*Config, error)

func ParseConfig

func ParseConfig(s string) (*Config, error)

ParseConfig parses the string s and extracts the s3 credentail. The supported format is: s3://ak:sk@endpoint/bucket?region=ap-northeast-1&sslmode=disable.

func (*Config) GetAddress

func (c *Config) GetAddress() string

type Embedded

type Embedded struct{}

func (Embedded) GetAddress

func (Embedded) GetAddress(ctx context.Context) (string, error)

func (Embedded) Run

func (Embedded) Run(ctx context.Context) error

type Manager

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

func NewManager

func NewManager(conf *Config) (*Manager, error)

NewManager creates a new storage manager.

func (*Manager) CheckValidBucketName

func (m *Manager) CheckValidBucketName(ctx context.Context, bucketName string) error

func (*Manager) DeleteRunPlan

func (m *Manager) DeleteRunPlan(ctx context.Context, run *model.ResourceRun) error

func (*Manager) GetAddress

func (m *Manager) GetAddress() string

func (*Manager) GetRunPlan

func (m *Manager) GetRunPlan(ctx context.Context, run *model.ResourceRun) ([]byte, error)

func (*Manager) SetRunPlan

func (m *Manager) SetRunPlan(ctx context.Context, run *model.ResourceRun, plan []byte) error

SetRunPlan sets the run plan files to s3 storage.

Jump to

Keyboard shortcuts

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