Documentation
¶
Overview ¶
Package vault contains gotd secret storage implementations using Hashicorp Vault.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Credentials ¶
type Credentials struct {
// contains filtered or unexported fields
}
Credentials stores user credentials to Vault.
func NewCredentials ¶
func NewCredentials(client *api.Client, path string) Credentials
NewCredentials creates new Credentials.
func (Credentials) Password ¶
func (a Credentials) Password(ctx context.Context) (p string, err error)
Password loads password from the Vault.
func (Credentials) Phone ¶
func (a Credentials) Phone(ctx context.Context) (p string, err error)
Phone loads phone from the Vault.
func (Credentials) SavePassword ¶
func (a Credentials) SavePassword(ctx context.Context, password string) error
SavePassword stores given password to the Vault.
type SessionStorage ¶
type SessionStorage struct {
// contains filtered or unexported fields
}
SessionStorage is a MTProto session Vault storage.
func NewSessionStorage ¶
func NewSessionStorage(client *api.Client, path, key string) SessionStorage
NewSessionStorage creates new SessionStorage.
func (SessionStorage) LoadSession ¶
func (s SessionStorage) LoadSession(ctx context.Context) ([]byte, error)
LoadSession loads session from Vault.
func (SessionStorage) StoreSession ¶
func (s SessionStorage) StoreSession(ctx context.Context, data []byte) error
StoreSession stores session to Vault.
Click to show internal directories.
Click to hide internal directories.