api

package
v0.0.0-...-4310c52 Latest Latest
Warning

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

Go to latest
Published: Dec 7, 2020 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var File_api_api_proto protoreflect.FileDescriptor

Functions

func NewApiEndpoints

func NewApiEndpoints() []*api.Endpoint

func RegisterApiHandler

func RegisterApiHandler(s server.Server, hdlr ApiHandler, opts ...server.HandlerOption) error

func RegisterApiServer

func RegisterApiServer(s *grpc.Server, srv ApiServer)

Types

type ApiClient

type ApiClient interface {
	Register(ctx context.Context, in *Endpoint, opts ...grpc.CallOption) (*EmptyResponse, error)
	Deregister(ctx context.Context, in *Endpoint, opts ...grpc.CallOption) (*EmptyResponse, error)
}

ApiClient is the client API for Api service.

For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream.

func NewApiClient

func NewApiClient(cc grpc.ClientConnInterface) ApiClient

type ApiHandler

type ApiHandler interface {
	Register(context.Context, *Endpoint, *EmptyResponse) error
	Deregister(context.Context, *Endpoint, *EmptyResponse) error
}

type ApiServer

type ApiServer interface {
	Register(context.Context, *Endpoint) (*EmptyResponse, error)
	Deregister(context.Context, *Endpoint) (*EmptyResponse, error)
}

ApiServer is the server API for Api service.

type ApiService

type ApiService interface {
	Register(ctx context.Context, in *Endpoint, opts ...client.CallOption) (*EmptyResponse, error)
	Deregister(ctx context.Context, in *Endpoint, opts ...client.CallOption) (*EmptyResponse, error)
}

func NewApiService

func NewApiService(name string, c client.Client) ApiService

type EmptyResponse

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

func (*EmptyResponse) Descriptor deprecated

func (*EmptyResponse) Descriptor() ([]byte, []int)

Deprecated: Use EmptyResponse.ProtoReflect.Descriptor instead.

func (*EmptyResponse) ProtoMessage

func (*EmptyResponse) ProtoMessage()

func (*EmptyResponse) ProtoReflect

func (x *EmptyResponse) ProtoReflect() protoreflect.Message

func (*EmptyResponse) Reset

func (x *EmptyResponse) Reset()

func (*EmptyResponse) String

func (x *EmptyResponse) String() string

type Endpoint

type Endpoint struct {
	Name   string   `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"`
	Host   []string `protobuf:"bytes,2,rep,name=host,proto3" json:"host,omitempty"`
	Path   []string `protobuf:"bytes,3,rep,name=path,proto3" json:"path,omitempty"`
	Method []string `protobuf:"bytes,4,rep,name=method,proto3" json:"method,omitempty"`
	Stream bool     `protobuf:"varint,5,opt,name=stream,proto3" json:"stream,omitempty"`
	// contains filtered or unexported fields
}

func (*Endpoint) Descriptor deprecated

func (*Endpoint) Descriptor() ([]byte, []int)

Deprecated: Use Endpoint.ProtoReflect.Descriptor instead.

func (*Endpoint) GetHost

func (x *Endpoint) GetHost() []string

func (*Endpoint) GetMethod

func (x *Endpoint) GetMethod() []string

func (*Endpoint) GetName

func (x *Endpoint) GetName() string

func (*Endpoint) GetPath

func (x *Endpoint) GetPath() []string

func (*Endpoint) GetStream

func (x *Endpoint) GetStream() bool

func (*Endpoint) ProtoMessage

func (*Endpoint) ProtoMessage()

func (*Endpoint) ProtoReflect

func (x *Endpoint) ProtoReflect() protoreflect.Message

func (*Endpoint) Reset

func (x *Endpoint) Reset()

func (*Endpoint) String

func (x *Endpoint) String() string

type Pair

type Pair struct {
	Key    string   `protobuf:"bytes,1,opt,name=key,proto3" json:"key,omitempty"`
	Values []string `protobuf:"bytes,2,rep,name=values,proto3" json:"values,omitempty"`
	// contains filtered or unexported fields
}

func (*Pair) Descriptor deprecated

func (*Pair) Descriptor() ([]byte, []int)

Deprecated: Use Pair.ProtoReflect.Descriptor instead.

func (*Pair) GetKey

func (x *Pair) GetKey() string

func (*Pair) GetValues

func (x *Pair) GetValues() []string

func (*Pair) ProtoMessage

func (*Pair) ProtoMessage()

func (*Pair) ProtoReflect

func (x *Pair) ProtoReflect() protoreflect.Message

func (*Pair) Reset

func (x *Pair) Reset()

func (*Pair) String

func (x *Pair) String() string

type Request

type Request struct {
	Method string           `protobuf:"bytes,1,opt,name=method,proto3" json:"method,omitempty"`
	Path   string           `protobuf:"bytes,2,opt,name=path,proto3" json:"path,omitempty"`
	Header map[string]*Pair ``                                                              /* 153-byte string literal not displayed */
	Get    map[string]*Pair ``                                                              /* 147-byte string literal not displayed */
	Post   map[string]*Pair ``                                                              /* 149-byte string literal not displayed */
	Body   string           `protobuf:"bytes,6,opt,name=body,proto3" json:"body,omitempty"` // raw request body; if not application/x-www-form-urlencoded
	Url    string           `protobuf:"bytes,7,opt,name=url,proto3" json:"url,omitempty"`   // the full url
	// contains filtered or unexported fields
}

func (*Request) Descriptor deprecated

func (*Request) Descriptor() ([]byte, []int)

Deprecated: Use Request.ProtoReflect.Descriptor instead.

func (*Request) GetBody

func (x *Request) GetBody() string

func (*Request) GetGet

func (x *Request) GetGet() map[string]*Pair

func (*Request) GetHeader

func (x *Request) GetHeader() map[string]*Pair

func (*Request) GetMethod

func (x *Request) GetMethod() string

func (*Request) GetPath

func (x *Request) GetPath() string

func (*Request) GetPost

func (x *Request) GetPost() map[string]*Pair

func (*Request) GetUrl

func (x *Request) GetUrl() string

func (*Request) ProtoMessage

func (*Request) ProtoMessage()

func (*Request) ProtoReflect

func (x *Request) ProtoReflect() protoreflect.Message

func (*Request) Reset

func (x *Request) Reset()

func (*Request) String

func (x *Request) String() string

type Response

type Response struct {
	StatusCode int32            `protobuf:"varint,1,opt,name=statusCode,proto3" json:"statusCode,omitempty"`
	Header     map[string]*Pair `` /* 153-byte string literal not displayed */
	Body       string           `protobuf:"bytes,3,opt,name=body,proto3" json:"body,omitempty"`
	// contains filtered or unexported fields
}

func (*Response) Descriptor deprecated

func (*Response) Descriptor() ([]byte, []int)

Deprecated: Use Response.ProtoReflect.Descriptor instead.

func (*Response) GetBody

func (x *Response) GetBody() string

func (*Response) GetHeader

func (x *Response) GetHeader() map[string]*Pair

func (*Response) GetStatusCode

func (x *Response) GetStatusCode() int32

func (*Response) ProtoMessage

func (*Response) ProtoMessage()

func (*Response) ProtoReflect

func (x *Response) ProtoReflect() protoreflect.Message

func (*Response) Reset

func (x *Response) Reset()

func (*Response) String

func (x *Response) String() string

type UnimplementedApiServer

type UnimplementedApiServer struct {
}

UnimplementedApiServer can be embedded to have forward compatible implementations.

func (*UnimplementedApiServer) Deregister

func (*UnimplementedApiServer) Register

Jump to

Keyboard shortcuts

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