actor

package
v1.5.1 Latest Latest
Warning

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

Go to latest
Published: Jun 29, 2022 License: MIT Imports: 22 Imported by: 0

Documentation

Index

Constants

View Source
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"
)
View Source
const TokenExpired = 60

TokenExpired is token's expired

Variables

View Source
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) Decode

func (im *ImageOperator) Decode(src io.Reader) error

Decode images

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

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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