google

package
v0.0.39 Latest Latest
Warning

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

Go to latest
Published: Feb 23, 2024 License: MIT Imports: 24 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrorReason_name = map[int32]string{
		0: "NOT_ALLOW_EXT",
	}
	ErrorReason_value = map[string]int32{
		"NOT_ALLOW_EXT": 0,
	}
)

Enum value maps for ErrorReason.

View Source
var File_fs_google_conf_proto protoreflect.FileDescriptor

Functions

func ErrorNotAllowExt

func ErrorNotAllowExt(format string, args ...interface{}) *errors.Error

为某个枚举单独设置错误码

func IsNotAllowExt

func IsNotAllowExt(err error) bool

为某个枚举单独设置错误码

Types

type Client

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

func New

func New(c *Conf) *Client

func (*Client) Close

func (c *Client) Close()

func (*Client) SaveWebSiteImage

func (c *Client) SaveWebSiteImage(url string) (string, error)

SaveWebSiteImage 转存网络上的视频或图片

func (*Client) UploadImage

func (c *Client) UploadImage(file []byte, fileName string) string

UploadImage 保存图片到google storage上

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"`
	CloudFront string `protobuf:"bytes,6,opt,name=cloud_front,json=cloudFront,proto3" json:"cloud_front,omitempty"`
	// contains filtered or unexported fields
}

func (*Conf) Descriptor deprecated

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

Deprecated: Use Conf.ProtoReflect.Descriptor instead.

func (*Conf) GetBucket

func (x *Conf) GetBucket() string

func (*Conf) GetCloudFront

func (x *Conf) GetCloudFront() string

func (*Conf) GetDir

func (x *Conf) GetDir() string

func (*Conf) GetKey

func (x *Conf) GetKey() string

func (*Conf) GetRegion

func (x *Conf) GetRegion() string

func (*Conf) GetSecret

func (x *Conf) GetSecret() string

func (*Conf) ProtoMessage

func (*Conf) ProtoMessage()

func (*Conf) ProtoReflect

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

func (*Conf) Reset

func (x *Conf) Reset()

func (*Conf) String

func (x *Conf) String() string

func (*Conf) Validate

func (m *Conf) Validate() error

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

func (m *Conf) ValidateAll() error

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
)

func (ErrorReason) Descriptor

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

Jump to

Keyboard shortcuts

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