cli

package
v0.0.0-...-7bf2daa Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 2, 2019 License: Apache-2.0 Imports: 22 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func EncodePublicKey

func EncodePublicKey(key *ephemeral.EphemeralKey) string

func EncodeTopicIdentityMessage

func EncodeTopicIdentityMessage(topic string, data proto.Message) ([]byte, error)

func EncodeTopicMessage

func EncodeTopicMessage(topic string, data proto.Message) ([]byte, error)

func ExecuteAuthFlow

func ExecuteAuthFlow(auth0 *Auth0, auth *Auth) (string, error)

func ReadEphemeralKeyFromFile

func ReadEphemeralKeyFromFile(path string) (*ephemeral.EphemeralKey, error)

func StartBot

func StartBot(options *BotOptions)

Types

type Auth

type Auth struct {
	IdentityURL string
	PubKey      string
}

func (*Auth) GetAccessToken

func (a *Auth) GetAccessToken(userToken string) (string, error)

type Auth0

type Auth0 struct {
	Domain       string
	Email        string
	Password     string
	ClientID     string
	ClientSecret string
	Audience     string
}

func (*Auth0) GetUserToken

func (a *Auth0) GetUserToken() (string, error)

type BotOptions

type BotOptions struct {
	Auth           authentication.ClientAuthenticator
	CoordinatorURL string
	Checkpoints    []V3
	DurationMs     uint
	Log            zerolog.Logger
	TrackStats     bool
}

type ClientAuthenticator

type ClientAuthenticator struct {
	IdentityURL  string
	EphemeralKey *ephemeral.EphemeralKey

	Email    string
	Password string

	Auth0Domain       string
	Auth0ClientID     string
	Auth0ClientSecret string
	Auth0Audience     string
	// contains filtered or unexported fields
}

func (*ClientAuthenticator) GenerateClientAuthMessage

func (a *ClientAuthenticator) GenerateClientAuthMessage() (*broker.AuthMessage, error)

func (*ClientAuthenticator) GenerateClientConnectURL

func (a *ClientAuthenticator) GenerateClientConnectURL(coordinatorURL string) (string, error)

type ProfileClient

type ProfileClient struct {
	ProfileURL   string
	EphemeralKey *ephemeral.EphemeralKey
}

func (*ProfileClient) RetrieveProfile

func (pc *ProfileClient) RetrieveProfile(accessToken string) (map[string]interface{}, error)

func (*ProfileClient) StoreProfile

func (pc *ProfileClient) StoreProfile(accessToken string, body io.Reader) error

type V3

type V3 struct {
	X float64
	Y float64
	Z float64
}

func (V3) Add

func (v V3) Add(a V3) V3

func (V3) Length

func (v V3) Length() float64

func (V3) Normalize

func (v V3) Normalize() V3

func (V3) ScalarProd

func (v V3) ScalarProd(n float64) V3

func (V3) Sub

func (v V3) Sub(a V3) V3

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL