blob

package
v1.29.0-mobile.3 Latest Latest
Warning

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

Go to latest
Published: Aug 17, 2018 License: BSD-2-Clause Imports: 15 Imported by: 0

Documentation

Index

Constants

View Source
const (
	SizeMaximum     = 100 * 1024 * 1024
	StatusAvailable = "available"
	StatusCreated   = "created"
)
View Source
const ErrorCodeDigestsNotEqual = "digests-not-equal"

Variables

This section is empty.

Functions

func ErrorDigestsNotEqual

func ErrorDigestsNotEqual(value string, calculated string) error

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"`
	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 Blobs

type Blobs []*Blob

type Client

type Client interface {
	List(ctx context.Context, userID string, filter *Filter, pagination *page.Pagination) (Blobs, error)
	Create(ctx context.Context, userID string, create *Create) (*Blob, 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
	Size      *int
}

func NewContent

func NewContent() *Content

func (*Content) Validate

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

type Create

type Create struct {
	Body      io.Reader
	DigestMD5 *string
	MediaType *string
}

func NewCreate

func NewCreate() *Create

func (*Create) Validate

func (c *Create) 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