hmac

package
v1.184.0 Latest Latest
Warning

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

Go to latest
Published: May 10, 2024 License: MIT Imports: 7 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

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

Module for fx.

Functions

func Generate

func Generate() (string, error)

Generate for hmac.

func IsEnabled

func IsEnabled(cfg *Config) bool

IsEnabled for hmac.

Types

type Algo

type Algo interface {
	// Generate an encoded msg.
	Generate(msg string) string

	// Compare encoded with msg.
	Compare(enc, msg string) error
}

Algo for hmac.

func NewAlgo

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

NewAlgo for hmac.

type Config

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

Config for hmac.

func (Config) GetKey

func (c Config) GetKey() string

GetKey from config or env.

Jump to

Keyboard shortcuts

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