Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CreateConfigDir ¶
func CreateConfigDir() error
CreateConfigDir - creates configuration directory tree.
func GetPrivateKeyFile ¶
func GetPrivateKeyFile() string
GetPrivateKeyFile - returns absolute path of private.key file.
func GetPublicCertFile ¶
func GetPublicCertFile() string
GetPublicCertFile - returns absolute path of public.crt file.
Types ¶
type ConfigDir ¶
ConfigDir - configuration directory with locking.
func (*ConfigDir) GetPrivateKeyFile ¶
GetPrivateKeyFile - returns absolute path of private.key file.
func (*ConfigDir) GetPublicCertFile ¶
GetPublicCertFile - returns absolute path of public.crt file.
type Credential ¶
type Credential struct { AccessKey string `xml:"AccessKeyId,omitempty" json:"accessKey,omitempty"` SecretKey string `xml:"SecretAccessKey,omitempty" json:"secretKey,omitempty"` Expiration time.Time `xml:"Expiration,omitempty" json:"expiration,omitempty"` }
Credential - container for access and secret key, also carries expiration which indicates when the associated acces/secret keys are going to be expired.
func NewCredential ¶
func NewCredential() (Credential, error)
NewCredential is similar to NewCredentialWithExpiration but the keys do not expire.
func NewCredentialWithExpiration ¶
func NewCredentialWithExpiration(expiration time.Time) (Credential, error)
NewCredentialWithExpiration returns new Credentials for the requested access key and secret key length. Returns an error if there was an error in generating credentials.Optionally expiration can be set to signify the validity of these generated credentials.
func (Credential) Equal ¶
func (c Credential) Equal(cc Credential) bool
Equal - returns whether two Credentials are equal or not.
func (Credential) IsExpired ¶
func (c Credential) IsExpired() bool
IsExpired - returns whether Credential is expired or not.
type Store ¶
type Store interface { // Sets a new credential to storage, returns a previous entry for the same accessKey. Set(cred Credential) (prevCred Credential) // Get fetch a saved credential for requested accessKey. Get(accessKey string) (cred Credential) // Delete a saved credential for the accessKey, returns a deleted copy of the entry. Delete(accessKey string) (prevCred Credential) // Loads all credentials from storage. Load() error // Saves all credentials to storage. Save() error }
Store represents credential storage interface of all the generated credentials.