# README

status

import "github.com/SuperBuker/terraform-provider-dns-he-net/client/status"

Index

Variables

TODO: extend ErrOTPAuthFailed?

var knownIssues = map[string]error{
    "Incorrect":                         &ErrAuthFailed{"Incorrect"},
    "The token supplied is invalid.":    &ErrOTPAuthFailed{"The token supplied is invalid."},
    "This token has already been used.": &ErrOTPAuthFailed{"This token has already been used. You may not reuse tokens."},
    "You may not reuse tokens.":         nil,
}

func Check

func Check(doc *html.Node) (string, []string, error)

Check checks all possible errors in the response. - If the user is not fully logged in. - If there are other contained errors. - If there are error messges in the response. - Sorts errors output by severity

func errorMerging

func errorMerging(errs []error) error

func errorScore

func errorScore(err error) int

func filterIssues

func filterIssues(issues []string) ([]string, []error)

func fromAuthStatus

func fromAuthStatus(status auth.Status) (err error)

fromAuthStatus returns an error asssociated to the auth status.

func fromIssue

func fromIssue(issues []string) (errs []error)

fromIssue parses the errors in the response and returns them as &ErrHeNet{}.

type ErrAuthFailed

ErrAuthFailed is an error that is returned when authentication fails.

type ErrAuthFailed struct {
    error string
}

func (*ErrAuthFailed) Error

func (e *ErrAuthFailed) Error() string

func (*ErrAuthFailed) Unwrap

func (e *ErrAuthFailed) Unwrap() []error

type ErrHeNet

ErrHeNet is an error returned when dns.he.net returns an error. It contains the error message returned in the HTML response.

type ErrHeNet struct {
    error string
}

func (*ErrHeNet) Error

func (e *ErrHeNet) Error() string

type ErrMissingOTPAuth

ErrMissingOTPAuth is an error returned when the user is not fully authenticated. It is used when dns.he.net returns that the client lacks OTP authentication. It includes two wrapped errors, ErrAuth and ErrHeNet.

type ErrMissingOTPAuth struct{}

func (*ErrMissingOTPAuth) Error

func (e *ErrMissingOTPAuth) Error() string

func (*ErrMissingOTPAuth) Unwrap

func (e *ErrMissingOTPAuth) Unwrap() []error

type ErrNoAuth

ErrNoAuth is an error returned when the user is not authenticated. It is used when dns.he.net returns that the client is not authenticated. It includes two wrapped errors, ErrAuth and ErrHeNet.

type ErrNoAuth struct{}

func (*ErrNoAuth) Error

func (e *ErrNoAuth) Error() string

func (*ErrNoAuth) Unwrap

func (e *ErrNoAuth) Unwrap() []error

type ErrOTPAuthFailed

ErrOTPAuthFailed is an error that is returned when authentication fails.

type ErrOTPAuthFailed struct {
    error string
}

func (*ErrOTPAuthFailed) Error

func (e *ErrOTPAuthFailed) Error() string

func (*ErrOTPAuthFailed) Unwrap

func (e *ErrOTPAuthFailed) Unwrap() []error

type ErrPartialAuth

ErrPartialAuth is an error that is returned when authentication is incomplete.

type ErrPartialAuth struct{}

func (*ErrPartialAuth) Error

func (e *ErrPartialAuth) Error() string

func (*ErrPartialAuth) Unwrap

func (e *ErrPartialAuth) Unwrap() []error

type ErrUnknownAuth

ErrUnknownAuth is an error returned when it's not possible to determine the authentication status. It includes two wrapped errors, ErrAuth and ErrHeNet.

type ErrUnknownAuth struct{}

func (*ErrUnknownAuth) Error

func (e *ErrUnknownAuth) Error() string

func (*ErrUnknownAuth) Unwrap

func (e *ErrUnknownAuth) Unwrap() []error

Generated by gomarkdoc