encrypt

package
v0.2.4 Latest Latest
Warning

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

Go to latest
Published: Mar 28, 2025 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Encrypter

type Encrypter interface {
	// Encrypt 加密数据
	Encrypt(data []byte) ([]byte, error)
	// Decrypt 解密数据
	Decrypt(data []byte) ([]byte, error)
}

Encrypter 是配置加密器接口

func NewAESEncrypter

func NewAESEncrypter(opts ...Option) (Encrypter, error)

NewAESEncrypter 创建一个基于AES的加密器

type Option

type Option func(*options)

Option 是加密器选项函数

func WithKey

func WithKey(key []byte) Option

WithKey 设置加密密钥

type Source

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

Source 是加密配置源包装器

func NewSource

func NewSource(source interface{}, encrypter Encrypter) *Source

NewSource 创建一个加密配置源

func (*Source) GetEncrypter

func (s *Source) GetEncrypter() Encrypter

GetEncrypter 获取加密器

func (*Source) GetSource

func (s *Source) GetSource() interface{}

GetSource 获取原始配置源

Jump to

Keyboard shortcuts

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