bucket

package
v0.0.0-...-affaa53 Latest Latest
Warning

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

Go to latest
Published: Jun 28, 2019 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BucketClient

type BucketClient interface {
	BucketExists(bucketName string) (bool, error)
	MakeBucket(bucketName string, location string) (err error)
	SetBucketPolicy(bucketName, policy string) error
}

BucketClient handles bucket operations on Minio

type Config

type Config struct {
	PrivatePrefix string `envconfig:"default=private"`
	PublicPrefix  string `envconfig:"default=public"`
	Region        string `envconfig:"default=us-east-1"`
}

Config stores configuration data for Handler

type Handler

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

Handler handles basic bucket operations

func NewHandler

func NewHandler(client BucketClient, cfg Config) *Handler

New returns a new instance of Handler

func (*Handler) CreateIfDoesntExist

func (h *Handler) CreateIfDoesntExist(bucketName, bucketRegion string) error

CreateBucketIfDoesntExist makes a new bucket on remote server if it doesn't exist yet

func (*Handler) CreateSystemBuckets

func (h *Handler) CreateSystemBuckets() (SystemBucketNames, error)

CreateSystemBuckets creates two system buckets: private and public ones

func (*Handler) SetPolicy

func (h *Handler) SetPolicy(bucketName, policy string) error

SetPolicy sets provided policy on a given bucket

type SystemBucketNames

type SystemBucketNames struct {
	Private string
	Public  string
}

SystemBucketNames stores names for system buckets

Directories

Path Synopsis
Code generated by mockery v1.0.0.
Code generated by mockery v1.0.0.

Jump to

Keyboard shortcuts

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