Documentation
¶
Index ¶
- Constants
- type APIKeyLevel
- type IPermitConfig
- type PermitBuilder
- type PermitConfig
- func (c *PermitConfig) Build() PermitConfig
- func (c *PermitConfig) GetApiUrl() string
- func (c *PermitConfig) GetContext() *PermitContext
- func (c *PermitConfig) GetDebug() bool
- func (c *PermitConfig) GetLogger() *zap.Logger
- func (c *PermitConfig) GetPdpUrl() string
- func (c *PermitConfig) GetToken() string
- func (c *PermitConfig) WithApiUrl(apiUrl string) *PermitConfig
- func (c *PermitConfig) WithContext(context *PermitContext) *PermitConfig
- func (c *PermitConfig) WithDebug(debug bool) *PermitConfig
- func (c *PermitConfig) WithLogger(logger *zap.Logger) *PermitConfig
- type PermitContext
- type PermitContextInterface
Constants ¶
View Source
const ( DefaultApiUrl = "https://api.permit.io" DefaultDebugMode = false DefaultPdpUrl = "http://localhost:7766" )
Default Builder consts
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type APIKeyLevel ¶
type APIKeyLevel int
const ( NoneAPIKeyLevel APIKeyLevel = iota OrganizationAPIKeyLevel ProjectAPIKeyLevel EnvironmentAPIKeyLevel )
func GetApiKeyLevel ¶
func GetApiKeyLevel(scope *models.APIKeyScopeRead) APIKeyLevel
type IPermitConfig ¶
type PermitBuilder ¶
type PermitBuilder struct {
PermitConfig
}
func NewConfigBuilder ¶
func NewConfigBuilder(token string) *PermitBuilder
type PermitConfig ¶
type PermitConfig struct {
Context *PermitContext
Logger *zap.Logger
// contains filtered or unexported fields
}
func NewPermitConfig ¶
func NewPermitConfig(apiUrl string, token string, pdpUrl string, debug bool, context *PermitContext, logger *zap.Logger) *PermitConfig
func (*PermitConfig) Build ¶
func (c *PermitConfig) Build() PermitConfig
func (*PermitConfig) GetApiUrl ¶
func (c *PermitConfig) GetApiUrl() string
func (*PermitConfig) GetContext ¶
func (c *PermitConfig) GetContext() *PermitContext
func (*PermitConfig) GetDebug ¶
func (c *PermitConfig) GetDebug() bool
func (*PermitConfig) GetLogger ¶
func (c *PermitConfig) GetLogger() *zap.Logger
func (*PermitConfig) GetPdpUrl ¶
func (c *PermitConfig) GetPdpUrl() string
func (*PermitConfig) GetToken ¶
func (c *PermitConfig) GetToken() string
func (*PermitConfig) WithApiUrl ¶
func (c *PermitConfig) WithApiUrl(apiUrl string) *PermitConfig
func (*PermitConfig) WithContext ¶
func (c *PermitConfig) WithContext(context *PermitContext) *PermitConfig
func (*PermitConfig) WithDebug ¶
func (c *PermitConfig) WithDebug(debug bool) *PermitConfig
func (*PermitConfig) WithLogger ¶
func (c *PermitConfig) WithLogger(logger *zap.Logger) *PermitConfig
type PermitContext ¶
type PermitContext struct {
APIKeyLevel APIKeyLevel
ProjectId string
EnvironmentId string
}
func NewPermitContext ¶
func NewPermitContext(apiKeyLevel APIKeyLevel, project string, environment string) *PermitContext
func PermitContextFactory ¶
func (*PermitContext) GetContext ¶
func (p *PermitContext) GetContext() *PermitContext
func (*PermitContext) GetEnvironment ¶
func (p *PermitContext) GetEnvironment() string
func (*PermitContext) GetProject ¶
func (p *PermitContext) GetProject() string
func (*PermitContext) SetContext ¶
func (p *PermitContext) SetContext(project string, environment string, apiKeyLevel APIKeyLevel)
type PermitContextInterface ¶
type PermitContextInterface interface {
GetProjectId() string
GetEnvironmentId() string
SetContext(project string, environment string)
GetContext() *PermitContext
}
Click to show internal directories.
Click to hide internal directories.