service

package
v0.0.0-...-e1a27db Latest Latest
Warning

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

Go to latest
Published: Feb 5, 2019 License: Apache-2.0 Imports: 22 Imported by: 1

Documentation

Index

Constants

View Source
const (
	// LogkeyTrainingDataService is the service name that will identify
	// the TDS in logging records.
	LogkeyTrainingDataService = "training-data-service"
)
View Source
const (

	// TdsDebug is the viper key to enable extended debug-session style logging in the TDS.
	TdsDebug = "tds_debug"
)

Variables

View Source
var (
	// TdsDebugMode = viper.GetBool(TdsDebug)
	TdsDebugMode = false

	// TdsDebugLogLineAdd outputs diagnostic loglines as they are added.  Should normally be false.
	TdsDebugLogLineAdd = false

	// TdsDebugEMetricAdd outputs diagnostic emetrics as they are added.  Should normally be false.
	TdsDebugEMetricAdd = false

	// TdsReportTimes if try report timings for Elastic Search operations
	TdsReportTimes = false
)

Functions

func InitViper

func InitViper()

InitViper is initializing the configuration system

Types

type Config

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

Config struct

type Lifecycle

type Lifecycle struct {
	Listener        net.Listener
	Server          *grpc.Server
	RegisterService func()
}

Lifecycle implements the lifecycle operations for microservice including dynamic service registration.

func (*Lifecycle) GetListenerAddress

func (s *Lifecycle) GetListenerAddress() string

GetListenerAddress will get the address and port the service is listening. Returns the empty string if the service is not running but the method is invoked.

func (*Lifecycle) Start

func (s *Lifecycle) Start(port int, background bool)

Start will start a gRPC microservice on a given port and run it either in foreground or background.

func (*Lifecycle) Stop

func (s *Lifecycle) Stop()

Stop will stop the gRPC microservice and the socket.

type LifecycleHandler

type LifecycleHandler interface {
	Start(port int, background bool)
	Stop()
	GetListenerAddress() string
}

LifecycleHandler provides basic lifecycle methods that each microservice has to implement.

type Service

type Service interface {
	tds.TrainingDataServer
	LifecycleHandler
}

Service represents the functionality of the training status service

func NewService

func NewService() Service

NewService creates a new training status recorder service.

type TrainingDataService

type TrainingDataService struct {
	Lifecycle
	// contains filtered or unexported fields
}

TrainingDataService holds the in-memory service context.

func (*TrainingDataService) AddEMetrics

func (c *TrainingDataService) AddEMetrics(ctx context.Context, in *tds.EMetrics) (*tds.AddResponse, error)

AddEMetrics adds the passed evaluation metrics record to storage.

func (*TrainingDataService) AddEMetricsBatch

func (c *TrainingDataService) AddEMetricsBatch(ctx context.Context,
	inBatch *tds.EMetricsBatch) (*tds.AddResponse, error)

AddEMetricsBatch adds the passed evaluation metrics record to storage. noinspection GoBoolExpressions

func (*TrainingDataService) AddLogLine

func (c *TrainingDataService) AddLogLine(ctx context.Context, in *tds.LogLine) (*tds.AddResponse, error)

AddLogLine adds the line line record to storage.

func (*TrainingDataService) AddLogLineBatch

func (c *TrainingDataService) AddLogLineBatch(ctx context.Context,
	inBatch *tds.LogLineBatch) (*tds.AddResponse, error)

AddLogLineBatch adds the line line record to storage. noinspection GoBoolExpressions

func (*TrainingDataService) DeleteEMetrics

func (c *TrainingDataService) DeleteEMetrics(ctx context.Context, in *tds.Query) (*tds.DeleteResponse, error)

DeleteEMetrics deletes the queried evaluation metrics from storage.

func (*TrainingDataService) DeleteJob

func (c *TrainingDataService) DeleteJob(ctx context.Context, in *tds.Query) (*tds.DeleteResponse, error)

DeleteJob deletes both queried evaluation metrics and log lines.

func (*TrainingDataService) DeleteLogLines

func (c *TrainingDataService) DeleteLogLines(ctx context.Context, in *tds.Query) (*tds.DeleteResponse, error)

DeleteLogLines deletes the queried log lines from storage.

func (*TrainingDataService) GetEMetrics

GetEMetrics returns a stream of evaluation metrics records.

func (*TrainingDataService) GetLogs

GetLogs returns a stream of log line records.

func (*TrainingDataService) Hello

Hello is simple a gRPC test endpoint.

Directories

Path Synopsis
Package grpc_training_data_v1 is a generated protocol buffer package.
Package grpc_training_data_v1 is a generated protocol buffer package.

Jump to

Keyboard shortcuts

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