vault

package
v0.1.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 8, 2021 License: MIT Imports: 5 Imported by: 0

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.

func (Credentials) SavePhone

func (a Credentials) SavePhone(ctx context.Context, phone string) error

SavePhone stores given phone 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.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL