Documentation ¶
Index ¶
Constants ¶
const ( // TypeDNS is the validation through DNS TXT records TypeDNS = "dns" // TypeKeyBase is the validation through KeyBase TypeKeyBase = "kb" // TypeGPG is the validation through GPG/PGP TypeGPG = "gpg" )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type DNSResolver ¶
type DNSResolver interface { // We only need LookupTXT for now. Add more if they are needed. LookupTXT(host string) ([]string, error) SetCallbackTXT(callbackFunc) }
DNSResolver is the interface for resolving DNS stuff
type DefaultResolver ¶
type DefaultResolver struct { }
DefaultResolver is a resolver that will pass through to the net.Resolver
func (*DefaultResolver) LookupTXT ¶
func (r *DefaultResolver) LookupTXT(host string) ([]string, error)
LookupTXT passes through to the default net resolver
func (*DefaultResolver) SetCallbackTXT ¶
func (r *DefaultResolver) SetCallbackTXT(_ callbackFunc)
SetCallbackTXT can set a callback for the LookupTXT resolver. Not used in the DefaultResolver
type Organisation ¶
type Organisation struct { Hash hash.Hash `json:"hash"` FullName string `json:"name"` PublicKey bmcrypto.PubKey `json:"public_key"` Validation []ValidationType `json:"validations"` }
Organisation is a structure that defines an organisation
type ValidationType ¶
ValidationType defines a validation method and data for validating an organisation in different ways
func NewValidationTypeFromString ¶
func NewValidationTypeFromString(s string) (*ValidationType, error)
NewValidationTypeFromString creates a new validation type from the given string
func NewValidationTypeFromStringArray ¶
func NewValidationTypeFromStringArray(arr []string) ([]ValidationType, error)
NewValidationTypeFromStringArray generates validation types based on an array of strings
func (*ValidationType) MarshalJSON ¶
func (v *ValidationType) MarshalJSON() ([]byte, error)
MarshalJSON marshals a key into bytes
func (*ValidationType) String ¶
func (v *ValidationType) String() string
func (*ValidationType) UnmarshalJSON ¶
func (v *ValidationType) UnmarshalJSON(b []byte) error
UnmarshalJSON unmarshals bytes into a key
func (*ValidationType) Validate ¶
func (v *ValidationType) Validate(o Organisation) (bool, error)
Validate will validate the given validation type and returns true when its validated correctly