Documentation ¶
Index ¶
- Constants
- func RegisterCrypto(name string, crypto Crypto)
- type Config
- type ConfigEntry
- type Crypto
- type CryptoFilter
- func (c *CryptoFilter) Destroy() error
- func (c *CryptoFilter) DoFilter(configFile *configconnector.ConfigFile, next configfilter.ConfigFileHandleFunc) configfilter.ConfigFileHandleFunc
- func (c *CryptoFilter) GetCrypto(algo string) (Crypto, error)
- func (c *CryptoFilter) Init(ctx *plugin.InitContext) error
- func (c *CryptoFilter) IsEnable(cfg config.Configuration) bool
- func (c *CryptoFilter) Name() string
- func (c *CryptoFilter) Type() common.Type
Constants ¶
View Source
const (
// PluginName crypto
PluginName = "crypto"
)
Variables ¶
This section is empty.
Functions ¶
func RegisterCrypto ¶
RegisterCrypto register crypto
Types ¶
type Config ¶
type Config struct {
Entries []ConfigEntry `yaml:"entries"`
}
Config crypto filter config
func (*Config) SetDefault ¶
func (c *Config) SetDefault()
SetDefault set default config.configFilter
type ConfigEntry ¶
ConfigEntry config entry
type Crypto ¶
type Crypto interface { GenerateKey() ([]byte, error) Encrypt(plaintext string, key []byte) (cryptotext string, err error) Decrypt(cryptotext string, key []byte) (string, error) }
Crypto Crypto interface
type CryptoFilter ¶
type CryptoFilter struct { *plugin.PluginBase // contains filtered or unexported fields }
CryptoFilter crypto filter plugin
func (*CryptoFilter) DoFilter ¶
func (c *CryptoFilter) DoFilter(configFile *configconnector.ConfigFile, next configfilter.ConfigFileHandleFunc) configfilter.ConfigFileHandleFunc
DoFilter do crypto filter
func (*CryptoFilter) GetCrypto ¶
func (c *CryptoFilter) GetCrypto(algo string) (Crypto, error)
GetCrypto get crypto by algorithm
func (*CryptoFilter) IsEnable ¶
func (c *CryptoFilter) IsEnable(cfg config.Configuration) bool
IsEnable enable
Click to show internal directories.
Click to hide internal directories.