Documentation ¶
Index ¶
- func NewProvisioningServer(instanceID string, serverConfiguration interface{}) (server.ProvisioningServer, error)
- type Account
- type AccountConfiguration
- type Credentials
- type MysqlConfig
- type ProvisioningServer
- func (p *ProvisioningServer) CreateAccount(productSN uint64, accountConfiguration interface{}) error
- func (p *ProvisioningServer) DeleteAccount(productSN uint64) error
- func (p *ProvisioningServer) GetAccount(productSN uint64) (server.Account, error)
- func (p *ProvisioningServer) RefreshAccount(productSN uint64) error
- func (p *ProvisioningServer) SuspendAccount(productSN uint64) error
- func (p *ProvisioningServer) UnsuspendAccount(productSN uint64) error
- func (p *ProvisioningServer) UpdateAccount(productSN uint64, accountConfiguration interface{}) error
- type ProvisioningServerConfig
- type ServerInfo
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewProvisioningServer ¶
func NewProvisioningServer(instanceID string, serverConfiguration interface{}) (server.ProvisioningServer, error)
Types ¶
type Account ¶
type Account struct {
// contains filtered or unexported fields
}
func (*Account) Credentials ¶
func (a *Account) Credentials() (server.Credentials, error)
type AccountConfiguration ¶
type AccountConfiguration struct { Password string `json:"password"` Quota float64 `json:"quota"` // in GB }
func ParseAccountConfiguration ¶
func ParseAccountConfiguration(config interface{}) (ac AccountConfiguration, err error)
func (AccountConfiguration) PasswordEncrypted ¶
func (ac AccountConfiguration) PasswordEncrypted() string
PasswordEncrypted() returns the password encrypted by the managed security module.
func (AccountConfiguration) PasswordSHA224 ¶
func (ac AccountConfiguration) PasswordSHA224() string
PasswordSHA224() calculates the SHA224 hash of the password, which is used by trojan
func (AccountConfiguration) QuotaBytes ¶
func (ac AccountConfiguration) QuotaBytes() int64
Quota() converts the quota from GB to bytes.
type Credentials ¶
type Credentials struct {
// contains filtered or unexported fields
}
func (*Credentials) Admin ¶
func (c *Credentials) Admin() (credentials []*server.Credential)
func (*Credentials) Customer ¶
func (c *Credentials) Customer() (credentials []*server.Credential)
type MysqlConfig ¶
type MysqlConfig struct { Host string `json:"host"` Port uint16 `json:"port"` User string `json:"user"` Password string `json:"password"` Database string `json:"database"` CACertPath string `json:"ca_cert_path"` ClientCertPath string `json:"client_cert_path"` ClientKeyPath string `json:"client_key_path"` }
type ProvisioningServer ¶
type ProvisioningServer struct {
// contains filtered or unexported fields
}
func (*ProvisioningServer) CreateAccount ¶
func (p *ProvisioningServer) CreateAccount(productSN uint64, accountConfiguration interface{}) error
func (*ProvisioningServer) DeleteAccount ¶
func (p *ProvisioningServer) DeleteAccount(productSN uint64) error
func (*ProvisioningServer) GetAccount ¶
func (p *ProvisioningServer) GetAccount(productSN uint64) (server.Account, error)
func (*ProvisioningServer) RefreshAccount ¶
func (p *ProvisioningServer) RefreshAccount(productSN uint64) error
Currently only clears data usage
func (*ProvisioningServer) SuspendAccount ¶
func (p *ProvisioningServer) SuspendAccount(productSN uint64) error
Update password_sha224 to some random stuff
func (*ProvisioningServer) UnsuspendAccount ¶
func (p *ProvisioningServer) UnsuspendAccount(productSN uint64) error
Recover password_sha224 from password_encrypted
func (*ProvisioningServer) UpdateAccount ¶
func (p *ProvisioningServer) UpdateAccount(productSN uint64, accountConfiguration interface{}) error
type ProvisioningServerConfig ¶
type ProvisioningServerConfig struct { Mysql MysqlConfig `json:"mysql"` Info ServerInfo `json:"server_info"` }
func ParseProvisioningServerConfig ¶
func ParseProvisioningServerConfig(v interface{}) (ProvisioningServerConfig, error)
func (ProvisioningServerConfig) ToJson ¶
func (psc ProvisioningServerConfig) ToJson() string
type ServerInfo ¶
Click to show internal directories.
Click to hide internal directories.