object

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Sep 27, 2024 License: MIT Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Configure

func Configure()

func Count

func Count(ctx context.Context, bucketName, startAfter string) (int, error)

func Delete

func Delete(ctx context.Context, o *Object) error

func Exists

func Exists(ctx context.Context, bucketName, key string) (bool, error)

func Write

func Write(ctx context.Context, o *Object, w io.Writer) error

Types

type CreateCommand

type CreateCommand struct {
	Key         string
	ContentType string
	Data        []byte
	Size        int64
}

type Object

type Object struct {
	ID          string
	Bucket      string
	Key         string
	ETag        string
	ContentType string
	Size        int64
	CreatedAt   time.Time
	Deleted     bool
}

func Create

func Create(ctx context.Context, bucketId string, cmd CreateCommand) (*Object, error)

func CreateWithChunk

func CreateWithChunk(ctx context.Context, bucketId, chunkId string, cmd CreateCommand) (*Object, error)

func FindMany

func FindMany(ctx context.Context, bucketName string, keys []string, deleted bool) ([]*Object, error)

func FindOne

func FindOne(ctx context.Context, bucketName, key string, deleted bool) (*Object, error)

func List

func List(ctx context.Context, bucketName, startAfter string, limit int) ([]*Object, error)

type PrefixIndex

type PrefixIndex struct {
	CommonPrefixes []string
	// contains filtered or unexported fields
}

func NewPrefixIndex

func NewPrefixIndex(delimiter, prefix string) *PrefixIndex

func (*PrefixIndex) AddKey

func (i *PrefixIndex) AddKey(key string) bool

AddKey adds a key to the index. The method returns true if this is a key match

type Stats

type Stats struct {
	ObjectCount int64
	TotalSize   int64
}

func StatsForBucket

func StatsForBucket(ctx context.Context, bucketName string) (*Stats, error)

Jump to

Keyboard shortcuts

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