service

package
v1.5.1 Latest Latest
Warning

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

Go to latest
Published: Feb 14, 2023 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrInvalidSignature       error = errors.New("invalid signature")
	ErrResourceClaimNotExists error = errors.New("resource claim does not exists")
	ErrResourceClaimType            = errors.New("resource claim cannot cast into string type")
)

Functions

This section is empty.

Types

type AlgKey

type AlgKey struct {
	Alg    jwa.KeyAlgorithm
	PubKey jwk.Key
}

type ImageRequest

type ImageRequest struct {
	URL       string       `json:"url"`
	Options   bimg.Options `json:"options"`
	Signature string       `json:"-"`
}

func NewImageRequest added in v1.5.1

func NewImageRequest(signature string) *ImageRequest

func ParseToken

func ParseToken(algKey AlgKey, queryToken string, debug bool) (*ImageRequest, error)

func (*ImageRequest) Download

func (ir *ImageRequest) Download() (remoteImage *RemoteImage, err error)

func (*ImageRequest) GetKey

func (ir *ImageRequest) GetKey(prefix string) (key string)

func (*ImageRequest) String

func (ir *ImageRequest) String() string

type ImageService

type ImageService interface {
	Process() ([]byte, error)
}

type RemoteImage

type RemoteImage struct {
	ImageRequest `json:"image_request"`
	Data         *[]byte `json:"data"`
}

func NewRemoteImage

func NewRemoteImage(opts ...RemoteImageOption) *RemoteImage

func (*RemoteImage) GetPair

func (remoteImage *RemoteImage) GetPair(prefix string) (key string, value string, err error)

func (*RemoteImage) ParseValue

func (remoteImage *RemoteImage) ParseValue(value string) error

func (*RemoteImage) Process

func (remoteImage *RemoteImage) Process() (err error)

func (*RemoteImage) String

func (remoteImage *RemoteImage) String() string

func (*RemoteImage) Type

func (remoteImage *RemoteImage) Type() string

type RemoteImageOption

type RemoteImageOption func(*RemoteImage)

func WithImageRequest

func WithImageRequest(imageRequest *ImageRequest) RemoteImageOption

func WithURL

func WithURL(url string) RemoteImageOption

func WithbimgOptions

func WithbimgOptions(options bimg.Options) RemoteImageOption

Jump to

Keyboard shortcuts

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