include.go 857 B

12345678910111213141516171819202122
  1. package hashstructure
  2. // Includable is an interface that can optionally be implemented by
  3. // a struct. It will be called for each field in the struct to check whether
  4. // it should be included in the hash.
  5. type Includable interface {
  6. HashInclude(field string, v interface{}) (bool, error)
  7. }
  8. // IncludableMap is an interface that can optionally be implemented by
  9. // a struct. It will be called when a map-type field is found to ask the
  10. // struct if the map item should be included in the hash.
  11. type IncludableMap interface {
  12. HashIncludeMap(field string, k, v interface{}) (bool, error)
  13. }
  14. // Hashable is an interface that can optionally be implemented by a struct
  15. // to override the hash value. This value will override the hash value for
  16. // the entire struct. Entries in the struct will not be hashed.
  17. type Hashable interface {
  18. Hash() (uint64, error)
  19. }