stages

package
v1.1.0-beta3 Latest Latest
Warning

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

Go to latest
Published: Dec 16, 2019 License: BSD-3-Clause Imports: 48 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var MAX_TIMEOUT = time.Second * 300
View Source
var TS_BATCH_SIZE = 500

Functions

func GetTLS

func GetTLS(host, cacheDir string) (*tls.Config, error)

func ParseDuration

func ParseDuration(expr string) (time.Duration, error)

Types

type ApiFrontendBasicStage

type ApiFrontendBasicStage struct {
	sync.Mutex
	// contains filtered or unexported fields
}

func (*ApiFrontendBasicStage) Fetch

pull data from Mortar gets called from frontend by GRPC server

func (*ApiFrontendBasicStage) GetAPIKey

func (*ApiFrontendBasicStage) GetQueue

func (stage *ApiFrontendBasicStage) GetQueue() chan *Request

func (*ApiFrontendBasicStage) GetUpstream

func (stage *ApiFrontendBasicStage) GetUpstream() Stage

get the stage we pull from

func (*ApiFrontendBasicStage) Qualify

identify which sites meet the requirements of the queries

func (*ApiFrontendBasicStage) SetUpstream

func (stage *ApiFrontendBasicStage) SetUpstream(upstream Stage)

set the stage we pull from

func (*ApiFrontendBasicStage) String

func (stage *ApiFrontendBasicStage) String() string

type ApiFrontendBasicStageConfig

type ApiFrontendBasicStageConfig struct {
	TLSCrtFile   string
	TLSKeyFile   string
	ListenAddr   string
	AuthConfig   CognitoAuthConfig
	Upstream     Stage
	StageContext context.Context
}

type ApiFrontendWAVEAuthStage

type ApiFrontendWAVEAuthStage struct {
	sync.Mutex
	// contains filtered or unexported fields
}

func (*ApiFrontendWAVEAuthStage) Fetch

pull data from Mortar gets called from frontend by GRPC server

func (*ApiFrontendWAVEAuthStage) GetAPIKey

func (*ApiFrontendWAVEAuthStage) GetQueue

func (stage *ApiFrontendWAVEAuthStage) GetQueue() chan *Request

func (*ApiFrontendWAVEAuthStage) GetUpstream

func (stage *ApiFrontendWAVEAuthStage) GetUpstream() Stage

get the stage we pull from

func (*ApiFrontendWAVEAuthStage) Qualify

identify which sites meet the requirements of the queries

func (*ApiFrontendWAVEAuthStage) SetUpstream

func (stage *ApiFrontendWAVEAuthStage) SetUpstream(upstream Stage)

set the stage we pull from

func (*ApiFrontendWAVEAuthStage) String

func (stage *ApiFrontendWAVEAuthStage) String() string

type ApiFrontendWAVEAuthStageConfig

type ApiFrontendWAVEAuthStageConfig struct {
	Namespace    string
	Agent        string
	EntityFile   string
	ProofFile    string
	ListenAddr   string
	Upstream     Stage
	StageContext context.Context
}

type BrickQueryStage

type BrickQueryStage struct {
	sync.Mutex
	// contains filtered or unexported fields
}

func NewBrickQueryStage

func NewBrickQueryStage(cfg *BrickQueryStageConfig) (*BrickQueryStage, error)

func (*BrickQueryStage) GetQueue

func (stage *BrickQueryStage) GetQueue() chan *Request

blocks on internal channel until next "Context" is ready

func (*BrickQueryStage) GetUpstream

func (stage *BrickQueryStage) GetUpstream() Stage

get the stage we pull from

func (*BrickQueryStage) SetUpstream

func (stage *BrickQueryStage) SetUpstream(upstream Stage)

set the stage we pull from

func (*BrickQueryStage) String

func (stage *BrickQueryStage) String() string

type BrickQueryStageConfig

type BrickQueryStageConfig struct {
	Upstream          Stage
	StageContext      context.Context
	HodConfigLocation string
}

type CognitoAuth

type CognitoAuth struct {
	sync.RWMutex
	// contains filtered or unexported fields
}

func NewCognitoAuth

func NewCognitoAuth(cfg CognitoAuthConfig) (*CognitoAuth, error)

type CognitoAuthConfig

type CognitoAuthConfig struct {
	// the client identifier for the app
	AppClientId string
	// the client secret
	AppClientSecret string
	// id of the user pool
	PoolId string
	// the .well-known/jwks.json URL
	JWKUrl string
	// region to query for the user pool
	Region string
}

type Config

type Config struct {
	// configuration for amazon cognito
	Cognito CognitoAuthConfig

	// wavemq frontend config
	WAVEMQ WAVEMQConfig

	// WAVE auth frontend config
	WAVE WAVEConfig

	HodConfig      string
	ListenAddr     string
	BTrDBAddr      string
	InfluxDBAddr   string
	InfluxDBUser   string
	InfluxDBPass   string
	PrometheusAddr string

	TLSCrtFile string
	TLSKeyFile string
}

func ReadConfig

func ReadConfig(file string) (*Config, error)

type InfluxDBTimeseriesQueryStage

type InfluxDBTimeseriesQueryStage struct {
	sync.Mutex
	// contains filtered or unexported fields
}

func (*InfluxDBTimeseriesQueryStage) GetQueue

func (stage *InfluxDBTimeseriesQueryStage) GetQueue() chan *Request

func (*InfluxDBTimeseriesQueryStage) GetUpstream

func (stage *InfluxDBTimeseriesQueryStage) GetUpstream() Stage

func (*InfluxDBTimeseriesQueryStage) SetUpstream

func (stage *InfluxDBTimeseriesQueryStage) SetUpstream(upstream Stage)

func (*InfluxDBTimeseriesQueryStage) String

func (stage *InfluxDBTimeseriesQueryStage) String() string

type InfluxDBTimeseriesStageConfig

type InfluxDBTimeseriesStageConfig struct {
	Upstream     Stage
	StageContext context.Context
	Username     string
	Password     string
	Address      string
}

type Request

type Request struct {
	sync.Mutex
	// contains filtered or unexported fields
}

func NewFetchRequest

func NewFetchRequest(ctx context.Context, fetch *mortarpb.FetchRequest) *Request

func NewQualifyRequest

func NewQualifyRequest(ctx context.Context, qualify *mortarpb.QualifyRequest) *Request

func (*Request) Done

func (request *Request) Done() <-chan struct{}

type SimpleLoadGenStage

type SimpleLoadGenStage struct {
	// contains filtered or unexported fields
}

func NewSimpleLoadGenStage

func NewSimpleLoadGenStage(contexts ...func() *Request) *SimpleLoadGenStage

func (*SimpleLoadGenStage) GetQueue

func (stage *SimpleLoadGenStage) GetQueue() chan *Request

blocks on internal channel until next "*Request" is ready

func (*SimpleLoadGenStage) GetUpstream

func (stage *SimpleLoadGenStage) GetUpstream() Stage

func (*SimpleLoadGenStage) SetUpstream

func (stage *SimpleLoadGenStage) SetUpstream(upstream Stage)

set the stage we pull from

func (*SimpleLoadGenStage) String

func (stage *SimpleLoadGenStage) String() string

type Stage

type Stage interface {
	// get the stage we pull from
	GetUpstream() Stage
	// set the stage we pull from
	SetUpstream(upstream Stage)
	// blocks on internal channel until next Request is ready
	GetQueue() chan *Request
	String() string
}

type TimeseriesQueryStage

type TimeseriesQueryStage struct {
	sync.Mutex
	// contains filtered or unexported fields
}

func NewTimeseriesQueryStage

func NewTimeseriesQueryStage(cfg *TimeseriesStageConfig) (*TimeseriesQueryStage, error)

func (*TimeseriesQueryStage) GetQueue

func (stage *TimeseriesQueryStage) GetQueue() chan *Request

func (*TimeseriesQueryStage) GetUpstream

func (stage *TimeseriesQueryStage) GetUpstream() Stage

func (*TimeseriesQueryStage) SetUpstream

func (stage *TimeseriesQueryStage) SetUpstream(upstream Stage)

func (*TimeseriesQueryStage) String

func (stage *TimeseriesQueryStage) String() string

type TimeseriesStageConfig

type TimeseriesStageConfig struct {
	Upstream     Stage
	StageContext context.Context
	BTrDBAddress string
}

type WAVEConfig

type WAVEConfig struct {
	// defaults to localhost:410
	Agent string
	// defaults to WAVE_DEFAULT_ENTITY
	EntityFile string
	// proof file for esrver
	ProofFile string
}

type WAVEMQConfig

type WAVEMQConfig struct {
	// defaults to localhost:4516
	SiteRouter string
	// defaults to WAVE_DEFAULT_ENTITY
	EntityFile string
	// namespace this is hosted on
	Namespace string
	// resource prefix for the server
	BaseURI string
	// name of the mortar service
	ServerName string
}

type WAVEMQFrontendStage

type WAVEMQFrontendStage struct {
	// contains filtered or unexported fields
}

func NewWAVEMQFrontendStage

func NewWAVEMQFrontendStage(cfg *WAVEMQFrontendStageConfig) (*WAVEMQFrontendStage, error)

func (*WAVEMQFrontendStage) Fetch

pull data from Mortar gets called from frontend by GRPC server

func (*WAVEMQFrontendStage) GetQueue

func (stage *WAVEMQFrontendStage) GetQueue() chan *Request

func (*WAVEMQFrontendStage) GetUpstream

func (stage *WAVEMQFrontendStage) GetUpstream() Stage

get the stage we pull from

func (*WAVEMQFrontendStage) Qualify

func (*WAVEMQFrontendStage) SetUpstream

func (stage *WAVEMQFrontendStage) SetUpstream(upstream Stage)

set the stage we pull from

func (*WAVEMQFrontendStage) String

func (stage *WAVEMQFrontendStage) String() string

type WAVEMQFrontendStageConfig

type WAVEMQFrontendStageConfig struct {
	SiteRouter string
	Namespace  string
	EntityFile string

	BaseURI    string
	ServerName string
}

Jump to

Keyboard shortcuts

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