blob

package
v1.32.2-hotfix.1 Latest Latest
Warning

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

Go to latest
Published: Feb 7, 2020 License: BSD-2-Clause Imports: 15 Imported by: 0

Documentation

Index

Constants

View Source
const (
	SizeMaximum     = 100 * 1024 * 1024
	StatusAvailable = "available"
	StatusCreated   = "created"
)

Variables

This section is empty.

Functions

func ErrorValueStringAsIDNotValid

func ErrorValueStringAsIDNotValid(value string) error

func IDValidator

func IDValidator(value string, errorReporter structure.ErrorReporter)

func IsValidID

func IsValidID(value string) bool

func NewID

func NewID() string

func Statuses

func Statuses() []string

func ValidateID

func ValidateID(value string) error

Types

type Blob

type Blob struct {
	ID           *string    `json:"id,omitempty" bson:"id,omitempty"`
	UserID       *string    `json:"userId,omitempty" bson:"userId,omitempty"`
	DigestMD5    *string    `json:"digestMD5,omitempty" bson:"digestMD5,omitempty"`
	MediaType    *string    `json:"mediaType,omitempty" bson:"mediaType,omitempty"`
	Size         *int       `json:"size,omitempty" bson:"size,omitempty"`
	Status       *string    `json:"status,omitempty" bson:"status,omitempty"`
	CreatedTime  *time.Time `json:"createdTime,omitempty" bson:"createdTime,omitempty"`
	ModifiedTime *time.Time `json:"modifiedTime,omitempty" bson:"modifiedTime,omitempty"`
	DeletedTime  *time.Time `json:"deletedTime,omitempty" bson:"deletedTime,omitempty"`
	Revision     *int       `json:"revision,omitempty" bson:"revision,omitempty"`
}

func (*Blob) Parse

func (b *Blob) Parse(parser structure.ObjectParser)

func (*Blob) Validate

func (b *Blob) Validate(validator structure.Validator)

type BlobArray added in v1.31.0

type BlobArray []*Blob

type Client

type Client interface {
	List(ctx context.Context, userID string, filter *Filter, pagination *page.Pagination) (BlobArray, error)
	Create(ctx context.Context, userID string, content *Content) (*Blob, error)
	DeleteAll(ctx context.Context, userID string) error
	Get(ctx context.Context, id string) (*Blob, error)
	GetContent(ctx context.Context, id string) (*Content, error)
	Delete(ctx context.Context, id string, condition *request.Condition) (bool, error)
}

type Content

type Content struct {
	Body      io.ReadCloser
	DigestMD5 *string
	MediaType *string
}

func NewContent

func NewContent() *Content

func (*Content) Validate

func (c *Content) Validate(validator structure.Validator)

type Filter

type Filter struct {
	MediaType *[]string
	Status    *[]string
}

func NewFilter

func NewFilter() *Filter

func (*Filter) MutateRequest

func (f *Filter) MutateRequest(req *http.Request) error

func (*Filter) Parse

func (f *Filter) Parse(parser structure.ObjectParser)

func (*Filter) Validate

func (f *Filter) Validate(validator structure.Validator)

Jump to

Keyboard shortcuts

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