service

package
v0.0.9 Latest Latest
Warning

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

Go to latest
Published: Aug 17, 2022 License: Apache-2.0 Imports: 20 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type GRPCService added in v0.0.4

type GRPCService struct {
	GRPCServiceConfiguration *GRPCServiceConfiguration
	Eval                     eval.IEvaluator
	gen.UnimplementedServiceServer
	Logger *log.Entry
}

func (*GRPCService) HandleEvaluationError added in v0.0.5

func (s *GRPCService) HandleEvaluationError(err error, reason string) error

func (*GRPCService) ResolveBoolean added in v0.0.4

TODO: might be able to simplify some of this with generics.

func (*GRPCService) ResolveFloat added in v0.0.6

func (s *GRPCService) ResolveFloat(
	ctx context.Context,
	req *gen.ResolveFloatRequest,
) (*gen.ResolveFloatResponse, error)

func (*GRPCService) ResolveInt added in v0.0.6

func (s *GRPCService) ResolveInt(
	ctx context.Context,
	req *gen.ResolveIntRequest,
) (*gen.ResolveIntResponse, error)

func (*GRPCService) ResolveObject added in v0.0.4

func (*GRPCService) ResolveString added in v0.0.4

func (*GRPCService) Serve added in v0.0.4

func (s *GRPCService) Serve(ctx context.Context, eval eval.IEvaluator) error

Serve allows for the use of GRPC only without HTTP, where as HTTP service enables both GRPC and HTTP

type GRPCServiceConfiguration added in v0.0.4

type GRPCServiceConfiguration struct {
	Port           int32
	ServerKeyPath  string
	ServerCertPath string
}

type HTTPService added in v0.0.3

type HTTPService struct {
	HTTPServiceConfiguration *HTTPServiceConfiguration
	GRPCService              *GRPCService
	Logger                   *log.Entry
}

func (HTTPService) HTTPErrorHandler added in v0.0.4

func (s HTTPService) HTTPErrorHandler(
	ctx context.Context,
	m *runtime.ServeMux,
	ma runtime.Marshaler,
	w http.ResponseWriter,
	r *http.Request,
	err error,
)

func (*HTTPService) Serve added in v0.0.3

func (s *HTTPService) Serve(ctx context.Context, eval eval.IEvaluator) error

func (*HTTPService) ServeHTTP added in v0.0.6

func (s *HTTPService) ServeHTTP(mux *runtime.ServeMux) *http.Server

func (*HTTPService) ServerGRPC added in v0.0.6

func (s *HTTPService) ServerGRPC(mux *runtime.ServeMux) *grpc.Server

type HTTPServiceConfiguration added in v0.0.3

type HTTPServiceConfiguration struct {
	Port           int32
	ServerCertPath string
	ServerKeyPath  string
}

type IService

type IService interface {
	Serve(ctx context.Context, eval eval.IEvaluator) error
}

IService implementations define handlers for a particular transport, which call the IEvaluator implementation.

type IServiceConfiguration

type IServiceConfiguration interface{}

Jump to

Keyboard shortcuts

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