filestore

package
v0.9.0 Latest Latest
Warning

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

Go to latest
Published: Apr 10, 2024 License: Apache-2.0 Imports: 27 Imported by: 0

Documentation

Index

Constants

View Source
const FilestoreURLPrefix = "/api/filestore/"

Variables

View Source
var File_resources_filestore_file_proto protoreflect.FileDescriptor

Functions

func StripURLPrefix added in v0.8.21

func StripURLPrefix(in string) string

Types

type File

type File struct {
	Url         *string `protobuf:"bytes,1,opt,name=url,proto3,oneof" json:"url,omitempty"`
	Data        []byte  `protobuf:"bytes,2,opt,name=data,proto3" json:"data,omitempty"`
	Delete      *bool   `protobuf:"varint,3,opt,name=delete,proto3,oneof" json:"delete,omitempty"`
	ContentType *string `protobuf:"bytes,4,opt,name=content_type,json=contentType,proto3,oneof" json:"content_type,omitempty"`
	Extension   *string `protobuf:"bytes,5,opt,name=extension,proto3,oneof" json:"extension,omitempty"`
	// contains filtered or unexported fields
}

func (*File) Descriptor deprecated

func (*File) Descriptor() ([]byte, []int)

Deprecated: Use File.ProtoReflect.Descriptor instead.

func (*File) GetContentType

func (x *File) GetContentType() string

func (*File) GetData

func (x *File) GetData() []byte

func (*File) GetDelete

func (x *File) GetDelete() bool

func (*File) GetExtension

func (x *File) GetExtension() string

func (*File) GetHash

func (x *File) GetHash() string

func (*File) GetUrl

func (x *File) GetUrl() string

func (*File) IsImage

func (x *File) IsImage() bool

func (*File) MatchFileExt added in v0.8.21

func (x *File) MatchFileExt() error

func (*File) Optimize

func (x *File) Optimize(ctx context.Context) error

func (*File) ProtoMessage

func (*File) ProtoMessage()

func (*File) ProtoReflect

func (x *File) ProtoReflect() protoreflect.Message

func (*File) Reset

func (x *File) Reset()

func (*File) Scan

func (x *File) Scan(value any) error

Scan implements driver.Valuer for protobuf DocumentAccess.

func (*File) String

func (x *File) String() string

func (*File) Upload

func (x *File) Upload(ctx context.Context, st storage.IStorage, prefix FilePrefix, fileName string) error

func (*File) Validate

func (m *File) Validate() error

Validate checks the field values on File with the rules defined in the proto definition for this message. If any rules are violated, the first error encountered is returned, or nil if there are no violations.

func (*File) ValidateAll

func (m *File) ValidateAll() error

ValidateAll checks the field values on File with the rules defined in the proto definition for this message. If any rules are violated, the result is a list of violation errors wrapped in FileMultiError, or nil if none found.

func (*File) Value

func (x *File) Value() (driver.Value, error)

Value marshals the value into driver.Valuer.

type FileInfo

type FileInfo struct {
	Name         string               `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"`
	LastModified *timestamp.Timestamp `protobuf:"bytes,2,opt,name=last_modified,json=lastModified,proto3,oneof" json:"last_modified,omitempty"`
	Size         int64                `protobuf:"varint,3,opt,name=size,proto3" json:"size,omitempty"`
	ContentType  string               `protobuf:"bytes,4,opt,name=content_type,json=contentType,proto3" json:"content_type,omitempty"`
	// contains filtered or unexported fields
}

func (*FileInfo) Descriptor deprecated

func (*FileInfo) Descriptor() ([]byte, []int)

Deprecated: Use FileInfo.ProtoReflect.Descriptor instead.

func (*FileInfo) GetContentType

func (x *FileInfo) GetContentType() string

func (*FileInfo) GetLastModified

func (x *FileInfo) GetLastModified() *timestamp.Timestamp

func (*FileInfo) GetName

func (x *FileInfo) GetName() string

func (*FileInfo) GetSize

func (x *FileInfo) GetSize() int64

func (*FileInfo) ProtoMessage

func (*FileInfo) ProtoMessage()

func (*FileInfo) ProtoReflect

func (x *FileInfo) ProtoReflect() protoreflect.Message

func (*FileInfo) Reset

func (x *FileInfo) Reset()

func (*FileInfo) String

func (x *FileInfo) String() string

func (*FileInfo) Validate

func (m *FileInfo) Validate() error

Validate checks the field values on FileInfo with the rules defined in the proto definition for this message. If any rules are violated, the first error encountered is returned, or nil if there are no violations.

func (*FileInfo) ValidateAll

func (m *FileInfo) ValidateAll() error

ValidateAll checks the field values on FileInfo with the rules defined in the proto definition for this message. If any rules are violated, the result is a list of violation errors wrapped in FileInfoMultiError, or nil if none found.

type FileInfoMultiError

type FileInfoMultiError []error

FileInfoMultiError is an error wrapping multiple validation errors returned by FileInfo.ValidateAll() if the designated constraints aren't met.

func (FileInfoMultiError) AllErrors

func (m FileInfoMultiError) AllErrors() []error

AllErrors returns a list of validation violation errors.

func (FileInfoMultiError) Error

func (m FileInfoMultiError) Error() string

Error returns a concatenation of all the error messages it wraps.

type FileInfoValidationError

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

FileInfoValidationError is the validation error returned by FileInfo.Validate if the designated constraints aren't met.

func (FileInfoValidationError) Cause

func (e FileInfoValidationError) Cause() error

Cause function returns cause value.

func (FileInfoValidationError) Error

func (e FileInfoValidationError) Error() string

Error satisfies the builtin error interface

func (FileInfoValidationError) ErrorName

func (e FileInfoValidationError) ErrorName() string

ErrorName returns error name.

func (FileInfoValidationError) Field

func (e FileInfoValidationError) Field() string

Field function returns field value.

func (FileInfoValidationError) Key

func (e FileInfoValidationError) Key() bool

Key function returns key value.

func (FileInfoValidationError) Reason

func (e FileInfoValidationError) Reason() string

Reason function returns reason value.

type FileMultiError

type FileMultiError []error

FileMultiError is an error wrapping multiple validation errors returned by File.ValidateAll() if the designated constraints aren't met.

func (FileMultiError) AllErrors

func (m FileMultiError) AllErrors() []error

AllErrors returns a list of validation violation errors.

func (FileMultiError) Error

func (m FileMultiError) Error() string

Error returns a concatenation of all the error messages it wraps.

type FilePrefix

type FilePrefix = string
const (
	Avatars   FilePrefix = "avatars"
	JobLogos  FilePrefix = "joblogos"
	MugShots  FilePrefix = "mugshots"
	JobAssets FilePrefix = "jobassets"
)

type FileValidationError

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

FileValidationError is the validation error returned by File.Validate if the designated constraints aren't met.

func (FileValidationError) Cause

func (e FileValidationError) Cause() error

Cause function returns cause value.

func (FileValidationError) Error

func (e FileValidationError) Error() string

Error satisfies the builtin error interface

func (FileValidationError) ErrorName

func (e FileValidationError) ErrorName() string

ErrorName returns error name.

func (FileValidationError) Field

func (e FileValidationError) Field() string

Field function returns field value.

func (FileValidationError) Key

func (e FileValidationError) Key() bool

Key function returns key value.

func (FileValidationError) Reason

func (e FileValidationError) Reason() string

Reason function returns reason value.

Jump to

Keyboard shortcuts

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