dispatcher

package
v0.8.0 Latest Latest
Warning

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

Go to latest
Published: Aug 28, 2019 License: Apache-2.0 Imports: 40 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewGRPCContext added in v0.8.0

func NewGRPCContext() (context.Context, context.CancelFunc)

Types

type GRPCClient added in v0.8.0

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

func NewGRPCClient added in v0.8.0

func NewGRPCClient(address string) (*GRPCClient, error)

func (*GRPCClient) BulkDelete added in v0.8.0

func (*GRPCClient) BulkIndex added in v0.8.0

func (*GRPCClient) Cancel added in v0.8.0

func (c *GRPCClient) Cancel()

func (*GRPCClient) Close added in v0.8.0

func (c *GRPCClient) Close() error

func (*GRPCClient) Delete added in v0.8.0

func (c *GRPCClient) Delete(req *distribute.DeleteRequest, opts ...grpc.CallOption) (*empty.Empty, error)

func (*GRPCClient) Get added in v0.8.0

func (*GRPCClient) GetAddress added in v0.8.0

func (c *GRPCClient) GetAddress() string

func (*GRPCClient) Index added in v0.8.0

func (c *GRPCClient) Index(req *distribute.IndexRequest, opts ...grpc.CallOption) (*empty.Empty, error)

func (*GRPCClient) NodeHealthCheck added in v0.8.0

func (*GRPCClient) Search added in v0.8.0

type GRPCGateway added in v0.8.0

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

func NewGRPCGateway added in v0.8.0

func NewGRPCGateway(grpcGatewayAddr string, grpcAddr string, logger *zap.Logger) (*GRPCGateway, error)

func (*GRPCGateway) GetAddress added in v0.8.0

func (s *GRPCGateway) GetAddress() (string, error)

func (*GRPCGateway) Start added in v0.8.0

func (s *GRPCGateway) Start() error

func (*GRPCGateway) Stop added in v0.8.0

func (s *GRPCGateway) Stop() error

type GRPCServer added in v0.8.0

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

func NewGRPCServer added in v0.8.0

func NewGRPCServer(grpcAddr string, service distribute.DistributeServer, logger *zap.Logger) (*GRPCServer, error)

func (*GRPCServer) Start added in v0.8.0

func (s *GRPCServer) Start() error

func (*GRPCServer) Stop added in v0.8.0

func (s *GRPCServer) Stop() error

type GRPCService

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

func NewGRPCService

func NewGRPCService(managerGrpcAddress string, logger *zap.Logger) (*GRPCService, error)

func (*GRPCService) BulkDelete added in v0.8.0

func (*GRPCService) BulkIndex added in v0.8.0

func (*GRPCService) Delete added in v0.8.0

func (*GRPCService) Get added in v0.8.0

func (*GRPCService) Index added in v0.8.0

func (*GRPCService) NodeHealthCheck added in v0.8.0

func (*GRPCService) Search

func (*GRPCService) Start

func (s *GRPCService) Start() error

func (*GRPCService) Stop

func (s *GRPCService) Stop() error

type HTTPServer added in v0.8.0

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

func NewHTTPServer added in v0.8.0

func NewHTTPServer(httpAddr string, router *Router, logger *zap.Logger, httpLogger accesslog.Logger) (*HTTPServer, error)

func (*HTTPServer) Start added in v0.8.0

func (s *HTTPServer) Start() error

func (*HTTPServer) Stop added in v0.8.0

func (s *HTTPServer) Stop() error

type JsonMarshaler added in v0.8.0

type JsonMarshaler struct{}

func (*JsonMarshaler) ContentType added in v0.8.0

func (*JsonMarshaler) ContentType() string

ContentType always Returns "application/json".

func (*JsonMarshaler) Delimiter added in v0.8.0

func (j *JsonMarshaler) Delimiter() []byte

Delimiter for newline encoded JSON streams.

func (*JsonMarshaler) Marshal added in v0.8.0

func (j *JsonMarshaler) Marshal(v interface{}) ([]byte, error)

Marshal marshals "v" into JSON

func (*JsonMarshaler) NewDecoder added in v0.8.0

func (j *JsonMarshaler) NewDecoder(r io.Reader) runtime.Decoder

NewDecoder returns a Decoder which reads JSON stream from "r".

func (*JsonMarshaler) NewEncoder added in v0.8.0

func (j *JsonMarshaler) NewEncoder(w io.Writer) runtime.Encoder

NewEncoder returns an Encoder which writes JSON stream into "w".

func (*JsonMarshaler) Unmarshal added in v0.8.0

func (j *JsonMarshaler) Unmarshal(data []byte, v interface{}) error

Unmarshal unmarshals JSON data into "v".

type JsonlMarshaler added in v0.8.0

type JsonlMarshaler struct{}

func (*JsonlMarshaler) ContentType added in v0.8.0

func (*JsonlMarshaler) ContentType() string

ContentType always Returns "application/json".

func (*JsonlMarshaler) Delimiter added in v0.8.0

func (j *JsonlMarshaler) Delimiter() []byte

Delimiter for newline encoded JSON streams.

func (*JsonlMarshaler) Marshal added in v0.8.0

func (j *JsonlMarshaler) Marshal(v interface{}) ([]byte, error)

Marshal marshals "v" into JSON

func (*JsonlMarshaler) NewDecoder added in v0.8.0

func (j *JsonlMarshaler) NewDecoder(r io.Reader) runtime.Decoder

NewDecoder returns a Decoder which reads JSON-LINE stream from "r".

func (*JsonlMarshaler) NewEncoder added in v0.8.0

func (j *JsonlMarshaler) NewEncoder(w io.Writer) runtime.Encoder

NewEncoder returns an Encoder which writes JSON stream into "w".

func (*JsonlMarshaler) Unmarshal added in v0.8.0

func (j *JsonlMarshaler) Unmarshal(data []byte, v interface{}) error

Unmarshal unmarshals JSON data into "v".

type RootHandler

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

func NewRootHandler

func NewRootHandler(logger *zap.Logger) *RootHandler

func (*RootHandler) ServeHTTP

func (h *RootHandler) ServeHTTP(w http.ResponseWriter, r *http.Request)

type Router added in v0.8.0

type Router struct {
	mux.Router
	// contains filtered or unexported fields
}

func NewRouter

func NewRouter(logger *zap.Logger) (*Router, error)

func (*Router) Close added in v0.8.0

func (r *Router) Close() error

type Server

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

func NewServer

func NewServer(managerGrpcAddress string, grpcAddress string, grpcGatewayAddress string, httpAddress string, logger *zap.Logger, grpcLogger *zap.Logger, httpLogger accesslog.Logger) (*Server, error)

func (*Server) Start

func (s *Server) Start()

func (*Server) Stop

func (s *Server) Stop()

type TextMarshaler added in v0.8.0

type TextMarshaler struct{}

func (*TextMarshaler) ContentType added in v0.8.0

func (*TextMarshaler) ContentType() string

ContentType always Returns "application/json".

func (*TextMarshaler) Delimiter added in v0.8.0

func (j *TextMarshaler) Delimiter() []byte

Delimiter for newline encoded JSON streams.

func (*TextMarshaler) Marshal added in v0.8.0

func (j *TextMarshaler) Marshal(v interface{}) ([]byte, error)

Marshal marshals "v" into JSON

func (*TextMarshaler) NewDecoder added in v0.8.0

func (j *TextMarshaler) NewDecoder(r io.Reader) runtime.Decoder

NewDecoder returns a Decoder which reads text stream from "r".

func (*TextMarshaler) NewEncoder added in v0.8.0

func (j *TextMarshaler) NewEncoder(w io.Writer) runtime.Encoder

NewEncoder returns an Encoder which writes JSON stream into "w".

func (*TextMarshaler) Unmarshal added in v0.8.0

func (j *TextMarshaler) Unmarshal(data []byte, v interface{}) error

Unmarshal unmarshals JSON data into "v".

Jump to

Keyboard shortcuts

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