Documentation
¶
Index ¶
- func Decrypt(ciphertext string) (string, error)
- func Encrypt(plaintext string) (string, error)
- func HashPassword(password string) string
- type Config
- func (c *Config) ClearCredentials() error
- func (c *Config) GetCredentials() (string, string, string, error)
- func (c *Config) GetToken() (string, time.Time, error)
- func (c *Config) IsTokenValid() bool
- func (c *Config) Save() error
- func (c *Config) SetCredentials(username, password, credType string) error
- func (c *Config) SetEndpoint(endpointID int) error
- func (c *Config) SetToken(jwt string, expiresAt time.Time) error
- func (c *Config) SetURL(url string) error
- type EncryptedCredentials
- type EncryptedToken
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func HashPassword ¶
Types ¶
type Config ¶
type Config struct {
URL string `json:"url"`
EndpointID int `json:"endpoint_id,omitempty"`
Credentials *EncryptedCredentials `json:"credentials,omitempty"`
Token *EncryptedToken `json:"token,omitempty"`
}
func LoadConfig ¶
func (*Config) ClearCredentials ¶
func (*Config) IsTokenValid ¶
func (*Config) SetCredentials ¶
func (*Config) SetEndpoint ¶
type EncryptedCredentials ¶
Click to show internal directories.
Click to hide internal directories.