middleware

package
v1.0.1-rc5 Latest Latest
Warning

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

Go to latest
Published: Apr 23, 2023 License: Apache-2.0 Imports: 18 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 ProjectNameModifier added in v1.1.0

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

Types

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 CurrentAccount

type CurrentAccount struct {
	models.Account
}

func CurrentAccountFromContext

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

func MustCurrentAccountFromContext added in v1.1.0

func MustCurrentAccountFromContext(ctx context.Context) *CurrentAccount

func (*CurrentAccount) ValidateProjectPerm

func (v *CurrentAccount) ValidateProjectPerm(ctx context.Context, prjID types.SFID) (*models.Project, error)

ValidateProjectPerm Deprecated: Use WithProjectContextByID instead

func (*CurrentAccount) ValidateProjectPermByPrjName

func (v *CurrentAccount) ValidateProjectPermByPrjName(ctx context.Context, projectName string) (*models.Project, error)

ValidateProjectPermByPrjName Deprecated: Use WithProjectContextByName instead

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 full contexts by applet SFID

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) 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) WithStrategyBySFID added in v1.1.0

func (v *CurrentAccount) WithStrategyBySFID(ctx context.Context, id types.SFID) (context.Context, 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