Documentation
¶
Index ¶
- func MaybeProjectName(ctx context.Context) (string, bool)
- func MustProjectName(ctx context.Context) string
- func ProjectNameModifier(ctx context.Context) (prefix string, err error)
- type ContextAccountAuth
- type CurrentAccount
- func (v *CurrentAccount) ValidateProjectPerm(ctx context.Context, prjID types.SFID) (*models.Project, error)
- func (v *CurrentAccount) ValidateProjectPermByPrjName(ctx context.Context, projectName string) (*models.Project, error)
- func (v *CurrentAccount) WithAccount(ctx context.Context) context.Context
- func (v *CurrentAccount) WithAppletContextBySFID(ctx context.Context, id types.SFID) (context.Context, error)
- func (v *CurrentAccount) WithInstanceContextBySFID(ctx context.Context, id types.SFID) (context.Context, error)
- func (v *CurrentAccount) WithProjectContextByName(ctx context.Context, name string) (context.Context, error)
- func (v *CurrentAccount) WithProjectContextBySFID(ctx context.Context, id types.SFID) (context.Context, error)
- func (v *CurrentAccount) WithPublisherBySFID(ctx context.Context, id types.SFID) (context.Context, error)
- func (v *CurrentAccount) WithStrategyBySFID(ctx context.Context, id types.SFID) (context.Context, error)
- type ProjectProvider
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func MustProjectName ¶ added in v1.1.0
Types ¶
type ContextAccountAuth ¶
func (*ContextAccountAuth) ContextKey ¶
func (r *ContextAccountAuth) ContextKey() string
type CurrentAccount ¶
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 (*CurrentAccount) WithStrategyBySFID ¶ added in v1.1.0
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
Click to show internal directories.
Click to hide internal directories.