serve

package
v0.0.27 Latest Latest
Warning

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

Go to latest
Published: Feb 28, 2022 License: Apache-2.0 Imports: 28 Imported by: 0

Documentation

Overview

Package serve implements the "jig serve" command, serving GRPC services via an evaluator.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewFS added in v0.0.21

func NewFS(vfs ...fs.FS) fs.FS

NewFS combines the top level directories of multiple fs.FS.

func NewFSFromDirs added in v0.0.21

func NewFSFromDirs(dirs ...string) fs.FS

NewFSFromDirs combines the top level directories of multiple directories.

Types

type Evaluator added in v0.0.21

type Evaluator interface {
	Evaluate(method, input string, vfs fs.FS) (output string, err error)
}

func JsonnetEvaluator added in v0.0.21

func JsonnetEvaluator() Evaluator

type EvaluatorFunc added in v0.0.21

type EvaluatorFunc func(method, input string, vfs fs.FS) (output string, err error)

func (EvaluatorFunc) Evaluate added in v0.0.21

func (ef EvaluatorFunc) Evaluate(method, input string, vfs fs.FS) (output string, err error)

type Option added in v0.0.16

type Option func(s *Server) error

Option is a functional option to configure Server

func WithLogger added in v0.0.17

func WithLogger(logger log.Logger) Option

func WithProtosets added in v0.0.19

func WithProtosets(protosets ...string) Option

type Server

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

func NewServer added in v0.0.14

func NewServer(eval Evaluator, vfs fs.FS, options ...Option) (*Server, error)

NewServer creates a new Server for given evaluator, e.g. Jsonnet and data Directories.

func (*Server) ListenAndServe added in v0.0.14

func (s *Server) ListenAndServe(listenAddr string) error

func (*Server) Serve added in v0.0.14

func (s *Server) Serve(lis net.Listener) error

func (*Server) ServeHTTP added in v0.0.26

func (s *Server) ServeHTTP(w http.ResponseWriter, r *http.Request)

func (*Server) Stop added in v0.0.8

func (s *Server) Stop()

type TestServer added in v0.0.8

type TestServer struct {
	Server
	// contains filtered or unexported fields
}

func NewTestServer added in v0.0.14

func NewTestServer(eval Evaluator, vfs fs.FS, options ...Option) *TestServer

NewTestServer starts and returns a new TestServer. The caller should call Stop when finished, to shut it down.

func (*TestServer) Addr added in v0.0.8

func (ts *TestServer) Addr() string

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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