proxy

package
v1.2.21 Latest Latest
Warning

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

Go to latest
Published: Dec 23, 2023 License: Apache-2.0 Imports: 14 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 transports.Client, signature signatures.Signature) shareds.Shared

func NewSharedHandler

func NewSharedHandler(shared shareds.Shared) transports.Handler

func NewSharedLockersHandler

func NewSharedLockersHandler(lockers shareds.Lockers) transports.Handler

func NewSharedStoreHandler

func NewSharedStoreHandler(store shareds.Store) transports.Handler

Types

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 LockParam

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

type LockResult

type LockResult struct {
	Id    []byte          `json:"id"`
	Error json.RawMessage `json:"error"`
}

type LockStatusParam

type LockStatusParam struct {
	Id []byte `json:"id"`
}

type LockStatusResult

type LockStatusResult struct {
	Pass  bool            `json:"pass"`
	Error json.RawMessage `json:"error"`
}

type Locker

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

func (*Locker) Lock

func (locker *Locker) Lock(ctx context.Context) (err error)

func (*Locker) Unlock

func (locker *Locker) Unlock(ctx context.Context) (err error)

type LockerStatus

type LockerStatus struct {
	Err error
	// contains filtered or unexported fields
}

type Lockers

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

func (*Lockers) Acquire

func (lockers *Lockers) Acquire(_ context.Context, key []byte, ttl time.Duration) (locker shareds.Locker, err error)

func (*Lockers) Close added in v1.2.0

func (lockers *Lockers) Close()

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 SharedLockersHandler

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

func (*SharedLockersHandler) 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) 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 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"`
}

type UnlockParam

type UnlockParam struct {
	Key []byte `json:"key"`
	Id  []byte `json:"id"`
}

type UnlockResult

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

Jump to

Keyboard shortcuts

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