entity

package
v0.0.0-...-6aec01b Latest Latest
Warning

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

Go to latest
Published: May 17, 2023 License: GPL-3.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewRequestError

func NewRequestError(err error) error

NewRequestError create RequestError from provided possibly gRPC error.

func Unwrap

func Unwrap(err error) error

Unwrap takes generic error and unwraps it to RequestError. If the provided error is not RequestError, it is returned as is.

Types

type Key

type Key struct {
	// contains filtered or unexported fields
}

Key is user's encyption key.

func NewKey

func NewKey(username string, password creds.Password) Key

NewKey creates new encryption key from the provided username and password.

func (Key) Decrypt

func (k Key) Decrypt(data []byte) ([]byte, error)

Decrypt decrypts provided bytes. Noop if data is empty.

func (Key) Encrypt

func (k Key) Encrypt(data []byte) ([]byte, error)

Encrypt encrypts provided message with secret key. Noop if data is empty.

func (Key) Hash

func (k Key) Hash() string

Hash provides hash of the encryption key.

type RequestError

type RequestError struct {
	// contains filtered or unexported fields
}

RequestError is custom error wrapper used incide keepctl to distinguish internal errors from returned from keeper service.

func (RequestError) Error

func (e RequestError) Error() string

Error returns error text. Required by Golang error interface.

Jump to

Keyboard shortcuts

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