Versions in this module Expand all Collapse all v1 v1.0.1 Aug 14, 2023 v1.0.0 Aug 11, 2023 Changes in this version + const TypeBase64 + const TypeBuffer + const TypeFile + const TypeQRCode + const TypeStream + const TypeUnknown + const TypeUrl + const TypeUuid + var ErrNoBase64Data = errors.New("no Base64 data") + var ErrNoPath = errors.New("no path") + var ErrNoQRCode = errors.New("no QR Code") + var ErrNoUrl = errors.New("no url") + var ErrNoUuid = errors.New("no uuid") + var ErrToJSON = errors.New("FileBox.toJSON() only support TypeUrl,TypeQRCode,TypeBase64, TypeUuid") + func SetUuidLoader(loader UuidLoader) + func SetUuidSaver(saver UuidSaver) + type FileBox struct + Name string + func FromBase64(encode string, options ...Option) *FileBox + func FromFile(path string, options ...Option) *FileBox + func FromJSON(s string) *FileBox + func FromQRCode(qrCode string, options ...Option) *FileBox + func FromStream(reader io.Reader, options ...Option) *FileBox + func FromUrl(urlString string, options ...Option) *FileBox + func FromUuid(uuid string, options ...Option) *FileBox + func (fb *FileBox) Error() error + func (fb *FileBox) MetaData() map[string]interface{} + func (fb *FileBox) Size() + func (fb *FileBox) String() string + func (fb *FileBox) ToBase64() (string, error) + func (fb *FileBox) ToBytes() ([]byte, error) + func (fb *FileBox) ToDataURL() (string, error) + func (fb *FileBox) ToFile(filePath string, overwrite bool) error + func (fb *FileBox) ToJSON() (string, error) + func (fb *FileBox) ToQRCode() (string, error) + func (fb *FileBox) ToReader() (io.Reader, error) + func (fb *FileBox) ToUuid() (string, error) + func (fb *FileBox) Type() Type + type Option func(options *Options) + func WithMd5(md5 string) Option + func WithMetadata(metadata map[string]interface{}) Option + func WithName(name string) Option + func WithOptions(o Options) Option + func WithSize(size int64) Option + type Options struct + type OptionsBase64 struct + Base64 string + type OptionsCommon struct + BoxType Type + BoxTypeDeprecated Type + Md5 string + Metadata map[string]interface{} + Name string + Size int64 + type OptionsQRCode struct + QrCode string + type OptionsUrl struct + Headers http.Header + RemoteUrl string + type OptionsUuid struct + Uuid string + type Type uint8 + func (i Type) String() string + type UuidLoader func(uuid string) (io.Reader, error) + type UuidSaver func(reader io.Reader) (uuid string, err error)