Documentation ¶
Index ¶
- Variables
- func ErrorConfigNotFound(format string, args ...interface{}) *errors.Error
- func ErrorNotAllowExt(format string, args ...interface{}) *errors.Error
- func IsConfigNotFound(err error) bool
- func IsNotAllowExt(err error) bool
- type Conf
- func (*Conf) Descriptor() ([]byte, []int)deprecated
- func (x *Conf) GetBucket() string
- func (x *Conf) GetDir() string
- func (x *Conf) GetKey() string
- func (x *Conf) GetRegion() string
- func (x *Conf) GetSecret() string
- func (*Conf) ProtoMessage()
- func (x *Conf) ProtoReflect() protoreflect.Message
- func (x *Conf) Reset()
- func (x *Conf) String() string
- func (m *Conf) Validate() error
- func (m *Conf) ValidateAll() error
- type ConfMultiError
- type ConfValidationError
- type ErrorReason
- func (ErrorReason) Descriptor() protoreflect.EnumDescriptor
- func (x ErrorReason) Enum() *ErrorReason
- func (ErrorReason) EnumDescriptor() ([]byte, []int)deprecated
- func (x ErrorReason) Number() protoreflect.EnumNumber
- func (x ErrorReason) String() string
- func (ErrorReason) Type() protoreflect.EnumType
- type S3Session
- func (c *S3Session) CopyObject(ctx context.Context, bucket, dir, filename string, src string) (string, error)
- func (c *S3Session) UploadAdminResource(ctx context.Context, file multipart.File, fileHeader *multipart.FileHeader) (string, error)
- func (c *S3Session) UploadApiAvatarDoc(ctx context.Context, file multipart.File, fileHeader *multipart.FileHeader, ...) (string, error)
- func (c *S3Session) UploadBytes(ctx context.Context, fileName string, data []byte) (string, error)
- func (c *S3Session) UploadBytesToBucketDir(ctx context.Context, bucket, dir, fileName string, data []byte) (string, error)
- func (c *S3Session) UploadBytesToDir(ctx context.Context, dir, fileName string, data []byte) (string, error)
- func (c *S3Session) UploadImage(ctx context.Context, imagePath string, fileName string, proxy *url.URL) (string, error)
- func (c *S3Session) UploadLazyMintFile(ctx context.Context, file multipart.File, fileHeader *multipart.FileHeader) (string, error)
- func (c *S3Session) UploadMultipart(ctx context.Context, fileHeader *multipart.FileHeader) (externalUrl string, err error)
Constants ¶
This section is empty.
Variables ¶
var ( ErrorReason_name = map[int32]string{ 0: "NOT_ALLOW_EXT", 1: "CONFIG_NOT_FOUND", } ErrorReason_value = map[string]int32{ "NOT_ALLOW_EXT": 0, "CONFIG_NOT_FOUND": 1, } )
Enum value maps for ErrorReason.
var File_fs_s3_conf_proto protoreflect.FileDescriptor
Functions ¶
func ErrorConfigNotFound ¶ added in v0.0.34
func ErrorNotAllowExt ¶
为某个枚举单独设置错误码
func IsConfigNotFound ¶ added in v0.0.34
Types ¶
type Conf ¶
type Conf struct { Key string `protobuf:"bytes,1,opt,name=key,proto3" json:"key,omitempty"` Secret string `protobuf:"bytes,2,opt,name=secret,proto3" json:"secret,omitempty"` Region string `protobuf:"bytes,3,opt,name=region,proto3" json:"region,omitempty"` Bucket string `protobuf:"bytes,4,opt,name=bucket,proto3" json:"bucket,omitempty"` Dir string `protobuf:"bytes,5,opt,name=dir,proto3" json:"dir,omitempty"` // contains filtered or unexported fields }
func (*Conf) Descriptor
deprecated
func (*Conf) ProtoMessage ¶
func (*Conf) ProtoMessage()
func (*Conf) ProtoReflect ¶
func (x *Conf) ProtoReflect() protoreflect.Message
func (*Conf) Validate ¶
Validate checks the field values on Conf 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 (*Conf) ValidateAll ¶
ValidateAll checks the field values on Conf 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 ConfMultiError, or nil if none found.
type ConfMultiError ¶
type ConfMultiError []error
ConfMultiError is an error wrapping multiple validation errors returned by Conf.ValidateAll() if the designated constraints aren't met.
func (ConfMultiError) AllErrors ¶
func (m ConfMultiError) AllErrors() []error
AllErrors returns a list of validation violation errors.
func (ConfMultiError) Error ¶
func (m ConfMultiError) Error() string
Error returns a concatenation of all the error messages it wraps.
type ConfValidationError ¶
type ConfValidationError struct {
// contains filtered or unexported fields
}
ConfValidationError is the validation error returned by Conf.Validate if the designated constraints aren't met.
func (ConfValidationError) Cause ¶
func (e ConfValidationError) Cause() error
Cause function returns cause value.
func (ConfValidationError) Error ¶
func (e ConfValidationError) Error() string
Error satisfies the builtin error interface
func (ConfValidationError) ErrorName ¶
func (e ConfValidationError) ErrorName() string
ErrorName returns error name.
func (ConfValidationError) Field ¶
func (e ConfValidationError) Field() string
Field function returns field value.
func (ConfValidationError) Key ¶
func (e ConfValidationError) Key() bool
Key function returns key value.
func (ConfValidationError) Reason ¶
func (e ConfValidationError) Reason() string
Reason function returns reason value.
type ErrorReason ¶
type ErrorReason int32
const ( // 为某个枚举单独设置错误码 ErrorReason_NOT_ALLOW_EXT ErrorReason = 0 ErrorReason_CONFIG_NOT_FOUND ErrorReason = 1 )
func (ErrorReason) Descriptor ¶
func (ErrorReason) Descriptor() protoreflect.EnumDescriptor
func (ErrorReason) Enum ¶
func (x ErrorReason) Enum() *ErrorReason
func (ErrorReason) EnumDescriptor
deprecated
func (ErrorReason) EnumDescriptor() ([]byte, []int)
Deprecated: Use ErrorReason.Descriptor instead.
func (ErrorReason) Number ¶
func (x ErrorReason) Number() protoreflect.EnumNumber
func (ErrorReason) String ¶
func (x ErrorReason) String() string
func (ErrorReason) Type ¶
func (ErrorReason) Type() protoreflect.EnumType
type S3Session ¶
type S3Session struct {
// contains filtered or unexported fields
}