aes

package
v1.213.2 Latest Latest
Warning

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

Go to latest
Published: Jun 5, 2024 License: MIT Imports: 7 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrInvalidLength = errors.New("invalid length")

ErrInvalidLength for aes.

View Source
var Module = fx.Options(
	fx.Provide(NewAlgo),
)

Module for fx.

Functions

func IsEnabled

func IsEnabled(cfg *Config) bool

IsEnabled for aes.

Types

type Algo

type Algo interface {
	// Encrypt msg.
	Encrypt(msg string) (string, error)

	// Decrypt msg.
	Decrypt(msg string) (string, error)
}

Algo for aes.

func NewAlgo

func NewAlgo(cfg *Config) (Algo, error)

NewAlgo for aes.

type Config

type Config struct {
	Key Key `yaml:"key,omitempty" json:"key,omitempty" toml:"key,omitempty"`
}

Config for aes.

func (*Config) GetKey

func (c *Config) GetKey() (string, error)

GetKey for aes.

type Key added in v1.189.0

type Key string

Key for aes.

func Generate

func Generate() (Key, error)

Generate for aes.

Jump to

Keyboard shortcuts

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