Documentation ¶
Index ¶
- Constants
- func InitClusters(url string, clusterIds ...string)
- func IsHfLink(url string) bool
- func ParseResult(bs []byte, result interface{}) error
- type Client
- func (c *Client) Call(module, method string, args interface{}, result interface{}) error
- func (c *Client) ImageCropResize(filePath string, crop []int, sizes [][]int) (result []string, err error)
- func (c *Client) Ls(filePath string) ([]FileInfo, error)
- func (c *Client) Read(filePath string) ([]byte, error)
- func (c *Client) Stat(filePath string) (FileInfo, error)
- type Cluster
- type Clusters
- type File
- type FileInfo
- type HfLink
- func (d HfLink) Call(module, method string, args, result interface{}) error
- func (d HfLink) CallAsync(module, method string, args interface{}) error
- func (d HfLink) ImageResize(crop []int, sizes [][]int) ([]HfLink, error)
- func (d HfLink) Mp4(videoId int, redisProgressKey string) error
- func (d HfLink) Parts() (string, string, string)
- func (d HfLink) Path() string
- func (d HfLink) Read() ([]byte, error)
- func (d HfLink) Stat() (FileInfo, error)
- func (d HfLink) String() string
- func (d HfLink) Url() string
- func (d HfLink) VideoCompressDash(videoId int, redisProgressKey string) error
- type ImageTransformParam
- type JsonResult
- type Methods
- func (c Methods) Call(clusterId, serverId, module, method string, args interface{}, ...) error
- func (c Methods) CallAsync(clusterId, serverId, module, method string, args interface{}) error
- func (m Methods) ImageCropResize(hf HfLink, crop []int, sizes [][]int) ([]HfLink, error)
- func (m Methods) Mp4(hf HfLink, videoId int, progressKey string) error
- func (m Methods) VideoCompressDash(hf HfLink, videoId int, progressKey string) error
- type NullHfLink
- func (s NullHfLink) HfLink() HfLink
- func (s NullHfLink) IsZero() bool
- func (s NullHfLink) MarshalJSON() ([]byte, error)
- func (s NullHfLink) MarshalText() ([]byte, error)
- func (s NullHfLink) Ptr() *string
- func (s *NullHfLink) SetValid(v string)
- func (s *NullHfLink) UnmarshalJSON(data []byte) error
- func (s *NullHfLink) UnmarshalText(text []byte) error
- func (s NullHfLink) Url() string
- type RedisService
- type Server
- type ServerUt
- type VideoCompressParam
- type Writer
Constants ¶
const ( CollectionImage = "image" CollectionVideo = "video" CollectionEpub = "epub" CollectionTxt = "txt" CollectionPdf = "pdf" CollectionBin = "bin" CollectionOffice = "office" CollectionZip = "zip" )
const ( FileStateNotStart = 0 FileStateUploading = 1 FileStateOk = 2 FileStateFail = 3 )
const ( StateOk = 0 StateError = 1 )
Variables ¶
This section is empty.
Functions ¶
func InitClusters ¶
func ParseResult ¶
Types ¶
type Client ¶
type Client struct {
Server string
}
func (*Client) ImageCropResize ¶
type Cluster ¶
type Cluster struct { Id string // contains filtered or unexported fields }
func (Cluster) ChooseServer ¶
type Clusters ¶
type Clusters struct {
// contains filtered or unexported fields
}
Clusters include many clusters
func GetClusters ¶
func GetClusters() *Clusters
type HfLink ¶
type HfLink string
HfLink := clusterId:serverId/relativePath
func WriteServer ¶
func (HfLink) ImageResize ¶
func (HfLink) Url ¶
eg. s:1/txt/00/00/yyfoatapk5/bdu9kjosiq.go -> http://xxx/txt/00/00/yyfoatapk5/bdu9kjosiq.go
type ImageTransformParam ¶
type JsonResult ¶
func (*JsonResult) Error ¶
func (r *JsonResult) Error() string
type Methods ¶
type Methods struct { }
func (Methods) ImageCropResize ¶
type NullHfLink ¶
type NullHfLink struct{ sql.NullString }
func FromHfLink ¶
func FromHfLink(s HfLink) NullHfLink
func NewNullHfLink ¶
func NewNullHfLink(s HfLink, valid bool) NullHfLink
NewString creates a new String
func (NullHfLink) HfLink ¶
func (s NullHfLink) HfLink() HfLink
func (NullHfLink) IsZero ¶
func (s NullHfLink) IsZero() bool
IsZero returns true for null strings, for potential future omitempty support.
func (NullHfLink) MarshalJSON ¶
func (s NullHfLink) MarshalJSON() ([]byte, error)
MarshalJSON implements json.Marshaler. It will encode null if this String is null.
func (NullHfLink) MarshalText ¶
func (s NullHfLink) MarshalText() ([]byte, error)
MarshalText implements encoding.TextMarshaler. It will encode a blank string when this String is null.
func (NullHfLink) Ptr ¶
func (s NullHfLink) Ptr() *string
Ptr returns a pointer to this String's value, or a nil pointer if this String is null.
func (*NullHfLink) SetValid ¶
func (s *NullHfLink) SetValid(v string)
SetValid changes this String's value and also sets it to be non-null.
func (*NullHfLink) UnmarshalJSON ¶
func (s *NullHfLink) UnmarshalJSON(data []byte) error
func (*NullHfLink) UnmarshalText ¶
func (s *NullHfLink) UnmarshalText(text []byte) error
UnmarshalText implements encoding.TextUnmarshaler. It will unmarshal to a null String if the input is a blank string.
func (NullHfLink) Url ¶
func (s NullHfLink) Url() string