Documentation
¶
Index ¶
- Constants
- Variables
- func IsReservedHeader(name string) bool
- func Path() (string, error)
- func ReadOnlySource(policy *Policy, profile *Profile, host string, flag bool) string
- type File
- type Policy
- type Profile
- func (p *Profile) BaseURL() (*url.URL, error)
- func (p *Profile) Collection() string
- func (p *Profile) HasCredentials() bool
- func (p *Profile) ResolvedHeaders() map[string]string
- func (p *Profile) ResolvedIdentity() string
- func (p *Profile) ResolvedPassword() string
- func (p *Profile) ResolvedToken() string
Constants ¶
View Source
const ( SuperusersCollection = "_superusers" EnvConfigPath = "PBCTL_CONFIG" EnvProfile = "PBCTL_PROFILE" EnvReadOnly = "PBCTL_READ_ONLY" EnvURL = "PBCTL_URL" EnvToken = "PBCTL_TOKEN" EnvIdentity = "PBCTL_IDENTITY" EnvPassword = "PBCTL_PASSWORD" EnvProfileName = "(environment)" )
Variables ¶
View Source
var PolicyPath = "/etc/pbctl/policy.json"
Functions ¶
func IsReservedHeader ¶ added in v0.1.1
Types ¶
type File ¶
type Policy ¶
type Policy struct {
ReadOnly bool `json:"read_only"`
ReadOnlyHosts []string `json:"read_only_hosts"`
}
func LoadPolicy ¶
func (*Policy) ForcesReadOnly ¶
type Profile ¶
type Profile struct {
URL string `json:"url"`
AuthCollection string `json:"auth_collection,omitempty"`
Identity string `json:"identity,omitempty"`
IdentityEnv string `json:"identity_env,omitempty"`
Password string `json:"password,omitempty"`
PasswordEnv string `json:"password_env,omitempty"`
Token string `json:"token,omitempty"`
TokenEnv string `json:"token_env,omitempty"`
Gateway bool `json:"gateway,omitempty"`
GatewayKey string `json:"gateway_key,omitempty"`
HeaderEnv map[string]string `json:"header_env,omitempty"`
ReadOnly bool `json:"read_only"`
ConfirmWrites bool `json:"confirm_writes,omitempty"`
}
func (*Profile) Collection ¶
func (*Profile) HasCredentials ¶
func (*Profile) ResolvedHeaders ¶ added in v0.1.1
func (*Profile) ResolvedIdentity ¶ added in v0.1.1
func (*Profile) ResolvedPassword ¶
func (*Profile) ResolvedToken ¶
Click to show internal directories.
Click to hide internal directories.