proxy

package
v1.2.85 Latest Latest
Warning

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

Go to latest
Published: Jan 27, 2024 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrInvalidPath         = errors.Warning("fns: invalid path")
	ErrInvalidBody         = errors.Warning("fns: invalid body")
	ErrSignatureLost       = errors.New(488, "***SIGNATURE LOST***", "X-Fns-Signature was required")
	ErrSignatureUnverified = errors.New(458, "***SIGNATURE INVALID***", "X-Fns-Signature was invalid")
)

Functions

func FetchEndpointInfos

func FetchEndpointInfos(ctx context.Context, client transports.Client, signature signatures.Signature) (infos services.EndpointInfos, err error)

func NewHandler

func NewHandler(signature signatures.Signature, manager services.EndpointsManager, shared shareds.Shared) transports.MuxHandler

func NewManagerHandler

func NewManagerHandler(manager services.EndpointsManager) transports.Handler

func NewShared

func NewShared(client ClientFetcher, signature signatures.Signature) shareds.Shared

func NewSharedHandler

func NewSharedHandler(shared shareds.Shared) transports.Handler

func NewSharedStoreHandler

func NewSharedStoreHandler(store shareds.Store) transports.Handler

Types

type ClientFetcher added in v1.2.80

type ClientFetcher func() transports.Client

type Command

type Command struct {
	Command string          `json:"command"`
	Payload json.RawMessage `json:"payload"`
}

func ParseCommand

func ParseCommand(r transports.Request) (cmd Command, err error)

type Handler

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

func (*Handler) Construct

func (handler *Handler) Construct(options transports.MuxHandlerOptions) error

func (*Handler) Handle

func (handler *Handler) Handle(w transports.ResponseWriter, r transports.Request)

func (*Handler) Match

func (handler *Handler) Match(_ context.Context, method []byte, path []byte, header transports.Header) bool

func (*Handler) Name

func (handler *Handler) Name() string

type ManagerHandler

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

func (*ManagerHandler) Handle

type Shared

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

func (*Shared) Close added in v1.2.0

func (shared *Shared) Close()

func (*Shared) Construct

func (shared *Shared) Construct(_ shareds.Options) (err error)

func (*Shared) Lockers

func (shared *Shared) Lockers() (lockers shareds.Lockers)

func (*Shared) Store

func (shared *Shared) Store() (store shareds.Store)

type SharedHandler

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

func (*SharedHandler) Handle

type SharedStoreHandler

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

func (*SharedStoreHandler) Handle

type Store

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

func (*Store) Close

func (store *Store) Close()

func (*Store) Expire added in v1.2.83

func (store *Store) Expire(ctx context.Context, key []byte, ttl time.Duration) (err error)

func (*Store) Get

func (store *Store) Get(ctx context.Context, key []byte) (value []byte, has bool, err error)

func (*Store) Incr

func (store *Store) Incr(ctx context.Context, key []byte, delta int64) (v int64, err error)

func (*Store) Remove

func (store *Store) Remove(ctx context.Context, key []byte) (err error)

func (*Store) Set

func (store *Store) Set(ctx context.Context, key []byte, value []byte) (err error)

func (*Store) SetWithTTL

func (store *Store) SetWithTTL(ctx context.Context, key []byte, value []byte, ttl time.Duration) (err error)

type StoreExpireParam added in v1.2.83

type StoreExpireParam struct {
	Key []byte        `json:"key"`
	TTL time.Duration `json:"ttl"`
}

type StoreExpireResult added in v1.2.83

type StoreExpireResult struct {
	Error json.RawMessage `json:"error"`
}

type StoreGetParam

type StoreGetParam struct {
	Key []byte `json:"key"`
}

type StoreGetResult

type StoreGetResult struct {
	Value []byte          `json:"value"`
	Has   bool            `json:"has"`
	Error json.RawMessage `json:"error"`
}

type StoreIncrParam

type StoreIncrParam struct {
	Key   []byte `json:"key"`
	Delta int64  `json:"delta"`
}

type StoreIncrResult

type StoreIncrResult struct {
	N     int64           `json:"n"`
	Error json.RawMessage `json:"error"`
}

type StoreRemoveParam

type StoreRemoveParam struct {
	Key []byte `json:"key"`
}

type StoreRemoveResult

type StoreRemoveResult struct {
	Error json.RawMessage `json:"error"`
}

type StoreSetParam

type StoreSetParam struct {
	Key   []byte `json:"key"`
	Value []byte `json:"value"`
}

type StoreSetResult

type StoreSetResult struct {
	Error json.RawMessage `json:"error"`
}

type StoreSetWithTTLParam

type StoreSetWithTTLParam struct {
	Key   []byte        `json:"key"`
	Value []byte        `json:"value"`
	TTL   time.Duration `json:"ttl"`
}

type StoreSetWithTTLResult

type StoreSetWithTTLResult struct {
	Error json.RawMessage `json:"error"`
}

Jump to

Keyboard shortcuts

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