appmain

package
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: Apr 2, 2020 License: Apache-2.0 Imports: 16 Imported by: 0

Documentation

Overview

Package appmain provides a runtime harness for Codecahedron services.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewExternalServiceProbe

func NewExternalServiceProbe(c *Clients, services ...string) func(context.Context) error

NewExternalServiceProbe indicates that a service should depend on other external services.

func Serve

func Serve(serviceName string, bindFunc func(p *apiserver.ServerParams, s *Services))

Serve runs Codecahedron common initialization code and starts the gRPC/HTTP server.

Types

type ClientSource

type ClientSource interface {
	NewContext() context.Context
	Grpc(string) (*grpc.ClientConn, func(), error)
	GrpcAddress(string) string
}

ClientSource provides service clients.

type Clients

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

Clients is a gRPC connection factory for Codecahedron services.

func NewClients

func NewClients(cfg util.ConfigView) *Clients

NewClients creates a new connection factory for communicating with any Codecahedron service.

func NewClientsFromSource

func NewClientsFromSource(cs ClientSource) *Clients

NewClientsFromSource creates a new connection factory based on a ClientSource.

func (*Clients) NewContext

func (c *Clients) NewContext() context.Context

NewContext provides a context suitable for communicating via gRPC/HTTP.

func (*Clients) NewDatastoreGRPC

func (c *Clients) NewDatastoreGRPC() (*grpc.ClientConn, func(), error)

NewDatastoreGRPC returns a gRPC connection to datastore service.

func (*Clients) NewEncodeWorkerGRPC

func (c *Clients) NewEncodeWorkerGRPC() (*grpc.ClientConn, func(), error)

NewEncodeWorkerGRPC returns a gRPC connection to encodeworker service.

func (*Clients) NewFilestoreGRPC

func (c *Clients) NewFilestoreGRPC() (*grpc.ClientConn, func(), error)

NewFilestoreGRPC returns a gRPC connection to filestore service.

func (*Clients) NewLogstoreGRPC

func (c *Clients) NewLogstoreGRPC() (*grpc.ClientConn, func(), error)

NewLogstoreGRPC returns a gRPC connection to logstore service.

func (*Clients) NewOperationsGRPC

func (c *Clients) NewOperationsGRPC() (*grpc.ClientConn, func(), error)

NewOperationsGRPC returns a gRPC connection to operations service.

func (*Clients) NewUserGRPC

func (c *Clients) NewUserGRPC() (*grpc.ClientConn, func(), error)

NewUserGRPC returns a gRPC connection to user service.

func (*Clients) NewWorkerPoolGRPC

func (c *Clients) NewWorkerPoolGRPC() (*grpc.ClientConn, func(), error)

NewWorkerPoolGRPC returns a gRPC connection to workerpool service.

type Services

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

Services contains all cross-cutting services for Codecahedron applications.

func NewServices

func NewServices(cfg util.ConfigView) *Services

NewServices configures and creates a services object for the application.

func (*Services) Clients

func (svc *Services) Clients() *Clients

Clients returns a service mapping/connection factory for all Codecahedron services.

func (*Services) Config

func (svc *Services) Config() util.ConfigView

Config returns a view of the configuration.

Directories

Path Synopsis
Package testing provides testing functionality running a Codecahedron server.
Package testing provides testing functionality running a Codecahedron server.

Jump to

Keyboard shortcuts

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