middleware

package
v1.6.5-rc24 Latest Latest
Warning

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

Go to latest
Published: Dec 7, 2023 License: Apache-2.0 Imports: 27 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func MaybeProjectName added in v1.1.0

func MaybeProjectName(ctx context.Context) (string, bool)

func MustProjectName added in v1.1.0

func MustProjectName(ctx context.Context) string

func ProjectNameForDisplay added in v1.1.0

func ProjectNameForDisplay(name string) (string, error)

func ProjectNameModifier added in v1.1.0

func ProjectNameModifier(ctx context.Context) (prefix string, err error)

Types

type AuthPayload added in v1.4.6

type AuthPayload struct {
	IdentityID   types.SFID
	IdentityType enums.AccessKeyIdentityType
}

func ParseJwtAuthContentFromContext added in v1.4.6

func ParseJwtAuthContentFromContext(ctx context.Context) (*AuthPayload, error)

type ContextAccountAuth

type ContextAccountAuth struct {
	httpx.MethodGet
}

func (*ContextAccountAuth) ContextKey

func (r *ContextAccountAuth) ContextKey() string

func (*ContextAccountAuth) Output

func (r *ContextAccountAuth) Output(ctx context.Context) (interface{}, error)

type ContextPublisherAuth added in v1.1.0

type ContextPublisherAuth struct {
	httpx.MethodGet
}

func (*ContextPublisherAuth) ContextKey added in v1.1.0

func (r *ContextPublisherAuth) ContextKey() string

func (*ContextPublisherAuth) Output added in v1.1.0

func (r *ContextPublisherAuth) Output(ctx context.Context) (interface{}, error)

type CurrentAccount

type CurrentAccount struct {
	models.Account
}

func CurrentAccountFromContext

func CurrentAccountFromContext(ctx context.Context) (*CurrentAccount, bool)

func MaybeCurrentAccountFromContext

func MaybeCurrentAccountFromContext(ctx context.Context) (*CurrentAccount, bool)

func MustCurrentAccountFromContext added in v1.1.0

func MustCurrentAccountFromContext(ctx context.Context) *CurrentAccount

func (*CurrentAccount) CheckRole added in v1.2.5

func (v *CurrentAccount) CheckRole(role enums.AccountRole) (*CurrentAccount, bool)

func (*CurrentAccount) WithAccount added in v1.1.0

func (v *CurrentAccount) WithAccount(ctx context.Context) context.Context

func (*CurrentAccount) WithAppletContextBySFID added in v1.1.0

func (v *CurrentAccount) WithAppletContextBySFID(ctx context.Context, id types.SFID) (context.Context, error)

WithAppletContextBySFID With applet contexts by applet SFID

func (*CurrentAccount) WithChainHeightBySFID added in v1.1.0

func (v *CurrentAccount) WithChainHeightBySFID(ctx context.Context, id types.SFID) (context.Context, error)

func (*CurrentAccount) WithChainTxBySFID added in v1.1.0

func (v *CurrentAccount) WithChainTxBySFID(ctx context.Context, id types.SFID) (context.Context, error)

func (*CurrentAccount) WithContractLogBySFID added in v1.1.0

func (v *CurrentAccount) WithContractLogBySFID(ctx context.Context, id types.SFID) (context.Context, error)

func (*CurrentAccount) WithCronJobBySFID added in v1.1.0

func (v *CurrentAccount) WithCronJobBySFID(ctx context.Context, id types.SFID) (context.Context, error)

func (*CurrentAccount) WithInstanceContextBySFID added in v1.1.0

func (v *CurrentAccount) WithInstanceContextBySFID(ctx context.Context, id types.SFID) (context.Context, error)

WithInstanceContextBySFID With full contexts by instance SFID

func (*CurrentAccount) WithOperatorBySFID added in v1.1.0

func (v *CurrentAccount) WithOperatorBySFID(ctx context.Context, id types.SFID) (context.Context, error)

func (*CurrentAccount) WithProjectContextByName

func (v *CurrentAccount) WithProjectContextByName(ctx context.Context, name string) (context.Context, error)

WithProjectContextByName With project context by project name(in database)

func (*CurrentAccount) WithProjectContextBySFID added in v1.1.0

func (v *CurrentAccount) WithProjectContextBySFID(ctx context.Context, id types.SFID) (context.Context, error)

WithProjectContextBySFID With project context by project SFID

func (*CurrentAccount) WithPublisherBySFID added in v1.1.0

func (v *CurrentAccount) WithPublisherBySFID(ctx context.Context, id types.SFID) (context.Context, error)

func (*CurrentAccount) WithResourceContextBySFID added in v1.2.3

func (v *CurrentAccount) WithResourceContextBySFID(ctx context.Context, id types.SFID) (context.Context, error)

func (*CurrentAccount) WithResourceOwnerContextBySFID added in v1.1.0

func (v *CurrentAccount) WithResourceOwnerContextBySFID(ctx context.Context, id types.SFID) (context.Context, error)

func (*CurrentAccount) WithStrategyBySFID added in v1.1.0

func (v *CurrentAccount) WithStrategyBySFID(ctx context.Context, id types.SFID) (context.Context, error)

func (*CurrentAccount) WithTrafficLimitContextBySFID added in v1.2.5

func (v *CurrentAccount) WithTrafficLimitContextBySFID(ctx context.Context, id types.SFID) (context.Context, error)

func (*CurrentAccount) WithTrafficLimitContextBySFIDAndProjectName added in v1.2.5

func (v *CurrentAccount) WithTrafficLimitContextBySFIDAndProjectName(ctx context.Context, id types.SFID) (context.Context, error)

type CurrentPublisher added in v1.1.0

type CurrentPublisher struct {
	*models.Publisher
}

func MaybePublisher

func MaybePublisher(ctx context.Context) (*CurrentPublisher, bool)

func MustPublisher added in v1.1.0

func MustPublisher(ctx context.Context) *CurrentPublisher

func PublisherFromContext added in v1.1.0

func PublisherFromContext(ctx context.Context) (*CurrentPublisher, bool)

func (*CurrentPublisher) WithAccountContext added in v1.1.0

func (v *CurrentPublisher) WithAccountContext(ctx context.Context) (context.Context, error)

func (*CurrentPublisher) WithProjectContext added in v1.1.0

func (v *CurrentPublisher) WithProjectContext(ctx context.Context) (context.Context, error)

func (*CurrentPublisher) WithStrategiesByChanAndType added in v1.1.0

func (v *CurrentPublisher) WithStrategiesByChanAndType(ctx context.Context, ch, tpe string) (context.Context, error)

type EventReqRateLimit added in v1.2.4

type EventReqRateLimit struct{}

func (*EventReqRateLimit) Output added in v1.2.4

func (r *EventReqRateLimit) Output(ctx context.Context) (interface{}, error)

type ProjectProvider added in v1.1.0

type ProjectProvider struct {
	ProjectName string `name:"projectName" in:"path" validate:"@projectName"`
}

ProjectProvider with account id prefix

func (ProjectProvider) ContextKey added in v1.1.0

func (ProjectProvider) ContextKey() string

func (*ProjectProvider) Output added in v1.1.0

func (r *ProjectProvider) Output(ctx context.Context) (interface{}, error)

func (ProjectProvider) Path added in v1.1.0

func (ProjectProvider) Path() string

Jump to

Keyboard shortcuts

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