Documentation ¶
Index ¶
- type Hash
- func (h *Hash) Dump(c interface{}) []byte
- func (h *Hash) Hash64(v interface{}) (uint64, *errorAVA.Error)
- func (h *Hash) HashMD5(c interface{}) string
- func (h *Hash) HashSHA256(c interface{}) []byte
- func (h *Hash) Md5(c interface{}) []byte
- func (h *Hash) Sha1(c interface{}) []byte
- func (h *Hash) Version() int
- type HashI
- type HashOptions
- type Includable
- type IncludableMap
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Hash ¶
type Hash struct {
// contains filtered or unexported fields
}
func (*Hash) Dump ¶
Dump takes a data structure and returns its byte representation. This can be useful if you need to use your own hashing function or formatter.
func (*Hash) HashMD5 ¶
HashMD5 takes a data structure and returns a hash string of that data structure at the version asked. This function uses md5 hashing function and default formatter. See also Dump() function.
func (*Hash) HashSHA256 ¶
HashSHA256 returns the sha 256 hash of the configurationServiceI in a standard base64 encoded string
func (*Hash) Md5 ¶
Md5 takes a data structure and returns its md5 hash. This is a shorthand for md5.Sum(Dump(c, version)).
type HashOptions ¶
type HashOptions struct { // Hasher is the hash function to use. If this isn't set, it will default to FNV. Hasher _hash.Hash64 // TagName is the struct tag to look at when hashing the structure. // By default this is "hash". TagName string // ZeroNil is flag determining if nil pointer should be treated equal to a zero value of pointed type. By default this is false. ZeroNil bool }
HashOptions are options that are available for hashing.
type Includable ¶
Includable is an interface that can optionally be implemented by a struct. It will be called for each field in the struct to check whether it should be included in the hash.
type IncludableMap ¶
type IncludableMap interface {
HashIncludeMap(field string, k, v interface{}) (bool, *errorAVA.Error)
}
IncludableMap is an interface that can optionally be implemented by a struct. It will be called when a map-type field is found to ask the struct if the map item should be included in the hash.