client

package
v0.5.0 Latest Latest
Warning

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

Go to latest
Published: Jan 3, 2017 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

View Source
const (
	//DefaultServerAddress amplifier address + port default
	DefaultServerAddress = "127.0.0.1:8080"
	//DefaultAdminServerAddress adm-server address + port default
	DefaultAdminServerAddress = "127.0.0.1:31315"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type AMP

type AMP struct {
	// Config contains all the configuration settings that were loaded
	Configuration *Configuration

	// Conn is the gRPC connection to amplifier
	Conn *grpc.ClientConn

	// Log also implements the grpclog.Logger interface
	Log Logger
}

AMP holds the state for the current environment

func NewAMP

func NewAMP(c *Configuration, l Logger) *AMP

NewAMP creates an AMP singleton instance (will only be configured with the first call)

func (*AMP) Connect

func (a *AMP) Connect() error

Connect to amplifier

func (*AMP) Disconnect

func (a *AMP) Disconnect()

Disconnect from amplifier

func (*AMP) GetAuthorizedContext

func (a *AMP) GetAuthorizedContext() (ctx context.Context, err error)

GetAuthorizedContext returns an authorized context

func (*AMP) GithubOauth

func (a *AMP) GithubOauth(username, password, otp string) (lastEight, name string, err error)

GithubOauth does an rpc call to login via github

func (*AMP) Verbose

func (a *AMP) Verbose() bool

Verbose returns true if verbose flag is set

type Configuration

type Configuration struct {
	Verbose            bool
	GitHub             string
	Target             string
	Port               string
	ServerAddress      string
	AdminServerAddress string
	CmdTheme           string
}

Configuration is for all configurable client settings

type Logger added in v0.5.0

type Logger interface {
	grpclog.Logger
	Panic(v ...interface{})
	Panicf(format string, v ...interface{})
	Panicln(v ...interface{})
}

Logger is a simple log interface that also implements grpclog.Logger

Jump to

Keyboard shortcuts

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