Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
var ( // ErrVHUTMissing indicates that the VHUT header is missing ErrVHUTMissing = errors.New("VH-Authenticate header absent") // ErrVHUTInvalidFormat indicates that the VHUT was not formatted properly ErrVHUTInvalidFormat = errors.New("Invalid VHUT format") )
Functions ¶
This section is empty.
Types ¶
type VHUT ¶
type VHUT struct {
// contains filtered or unexported fields
}
VHUT represents a VH User Token
func (*VHUT) InitFromFile ¶
InitFromFile initializes member vhut from contents of the file. This will most likley be invoked by a CLI program that stores the VHUT in a file Returns non-nil error if the file doesn't exist, can't be read or the data doesn't match the VHUT format. It is to be noted that this method doesn't validate the token
func (*VHUT) InitFromString ¶
InitFromString initializes member vhut from a string.
func (*VHUT) UpdateRequest ¶
UpdateRequest adds custom HTTP request header "VH-Authenticate" with vhut as value. This will most likely be invoked by a client program before making a HTTP(S) request. Updates the value if header "VH-Authenticate" already exists in the request r. Returns non-nil error if vhut is not initialized.