Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GenerateToken ¶
func GenerateToken() string
GenerateToken returns a token which can be used for pairing
Types ¶
type PairConfig ¶
type PairConfig struct {
// contains filtered or unexported fields
}
PairConfig is the pairing configuration structure
func (*PairConfig) Apply ¶
func (c *PairConfig) Apply(opts ...PairOption) error
Apply sets the given option to the configuration
type PairOption ¶
type PairOption func(c *PairConfig) error
PairOption is a config pair option
func WithLogLevel ¶
func WithLogLevel(t string) PairOption
WithLogLevel sets the loglevel of the pairing operation
func WithReader ¶
func WithReader(t TokenReader) PairOption
WithReader sets the token reader. If set, during send is invoked to retrieve a token from the specified string from the client (if any)
func WithToken ¶
func WithToken(t string) PairOption
WithToken sets the token as a pair option The token is consumed by TokenReader to parse the string and retrieve a token from it.
type TokenReader ¶
TokenReader is a function that reads a string and returns a token from it. A string can represent anything (uri, image file, etc.) which can be used to retrieve the connection token