Documentation ¶
Index ¶
- Constants
- Variables
- func NewCachedContentOperator() repository.CachedContentRepository
- func NewImageOperator(ctx context.Context, contenttype string, option ImageOperatorOption) repository.ImageObjectRepository
- func NewJwtOperator(ctx context.Context, username string, admin bool, expired time.Duration) repository.JwtClaimsRepository
- type CachedContentOperator
- func (e *CachedContentOperator) GetContent() []byte
- func (e *CachedContentOperator) GetContentType() string
- func (e *CachedContentOperator) GetLastModified() string
- func (e *CachedContentOperator) GobDecode(buf []byte) error
- func (e *CachedContentOperator) GobEncode() ([]byte, error)
- func (e *CachedContentOperator) Set(contentType, lastModified string, content []byte)
- type ImageOperator
- type ImageOperatorOption
- type JwtOperator
Constants ¶
const ( // ImageRotateRight is rotate image 90 degree right ImageRotateRight = "right" // ImageRotateLeft is rotate image 90 degree left ImageRotateLeft = "left" // ImageRotateUpsidedown is rotate image upside down ImageRotateUpsidedown = "upsidedown" // ImageRotateAutoVertical is rotate image auto vertical ImageRotateAutoVertical = "autovertical" // ImageRotateAutoHorizontal is rotate image auto horizontal ImageRotateAutoHorizontal = "autohorizontal" )
const TokenExpired = 60
TokenExpired is token's expired
Variables ¶
var TokenSecret = os.Getenv("TOKEN_SECRET")
TokenSecret define token secrets
Functions ¶
func NewCachedContentOperator ¶
func NewCachedContentOperator() repository.CachedContentRepository
NewCachedContentOperator creates a new CachedContentRepository
func NewImageOperator ¶
func NewImageOperator(ctx context.Context, contenttype string, option ImageOperatorOption) repository.ImageObjectRepository
NewImageOperator creates a new ImageObjectRepository
func NewJwtOperator ¶
func NewJwtOperator(ctx context.Context, username string, admin bool, expired time.Duration) repository.JwtClaimsRepository
NewJwtOperator creates a new JwtClaimsRepository
Types ¶
type CachedContentOperator ¶
type CachedContentOperator struct {
// contains filtered or unexported fields
}
CachedContentOperator struct
func (*CachedContentOperator) GetContent ¶
func (e *CachedContentOperator) GetContent() []byte
GetContent returns content of cahced content
func (*CachedContentOperator) GetContentType ¶
func (e *CachedContentOperator) GetContentType() string
GetContentType returns contenttype of cahced content
func (*CachedContentOperator) GetLastModified ¶
func (e *CachedContentOperator) GetLastModified() string
GetLastModified returns lastmodified of cahced content
func (*CachedContentOperator) GobDecode ¶
func (e *CachedContentOperator) GobDecode(buf []byte) error
GobDecode decode bytes to cached data
func (*CachedContentOperator) GobEncode ¶
func (e *CachedContentOperator) GobEncode() ([]byte, error)
GobEncode serialized cached data to bytes
func (*CachedContentOperator) Set ¶
func (e *CachedContentOperator) Set(contentType, lastModified string, content []byte)
Set sets contentType,lastModified and content to cahced content
type ImageOperator ¶
type ImageOperator struct {
// contains filtered or unexported fields
}
ImageOperator struct
func (*ImageOperator) ImageByte ¶
func (im *ImageOperator) ImageByte() ([]byte, error)
ImageByte get image bytes
func (*ImageOperator) Process ¶
func (im *ImageOperator) Process() error
Process images process resize and more
type ImageOperatorOption ¶
type ImageOperatorOption entity.ImageObjectOption
ImageOperatorOption is Option of ImageOperator struct
type JwtOperator ¶
type JwtOperator struct {
// contains filtered or unexported fields
}
JwtOperator struct
func (*JwtOperator) CreateToken ¶
func (jc *JwtOperator) CreateToken(secret string) string
CreateToken creates a new token