kernal

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Dec 17, 2018 License: Apache-2.0 Imports: 16 Imported by: 0

Documentation

Index

Constants

View Source
const (
	Skey = "_server"
)

Variables

This section is empty.

Functions

func Debug

func Debug(ctx context.Context, format string, v ...interface{})

func Error

func Error(ctx context.Context, format string, v ...interface{})

func ErrorPanic

func ErrorPanic(err error)

func FetchServiceConn

func FetchServiceConn(name string, s *Server) *grpc.ClientConn

func FetchServiceConnByCtx

func FetchServiceConnByCtx(ctx context.Context, name string) *grpc.ClientConn

func GetValidIP

func GetValidIP() string

func GetValidPort

func GetValidPort(ip string) int

func Info

func Info(ctx context.Context, format string, v ...interface{})

func NewInterceptors

func NewInterceptors(s *Server) *interceptors

func RegisterHttpServiceServer

func RegisterHttpServiceServer(s *grpc.Server, srv HttpServiceServer)

func ReleaseLogger

func ReleaseLogger(s *Server)

Types

type HttpReq

type HttpReq struct {
	ServiceName          string   `protobuf:"bytes,1,opt,name=service_name,json=serviceName,proto3" json:"service_name,omitempty"`
	Method               string   `protobuf:"bytes,2,opt,name=method,proto3" json:"method,omitempty"`
	Body                 string   `protobuf:"bytes,3,opt,name=body,proto3" json:"body,omitempty"`
	XXX_NoUnkeyedLiteral struct{} `json:"-"`
	XXX_unrecognized     []byte   `json:"-"`
	XXX_sizecache        int32    `json:"-"`
}

func (*HttpReq) Descriptor

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

func (*HttpReq) GetBody

func (m *HttpReq) GetBody() string

func (*HttpReq) GetMethod

func (m *HttpReq) GetMethod() string

func (*HttpReq) GetServiceName

func (m *HttpReq) GetServiceName() string

func (*HttpReq) ProtoMessage

func (*HttpReq) ProtoMessage()

func (*HttpReq) Reset

func (m *HttpReq) Reset()

func (*HttpReq) String

func (m *HttpReq) String() string

func (*HttpReq) XXX_DiscardUnknown

func (m *HttpReq) XXX_DiscardUnknown()

func (*HttpReq) XXX_Marshal

func (m *HttpReq) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*HttpReq) XXX_Merge

func (m *HttpReq) XXX_Merge(src proto.Message)

func (*HttpReq) XXX_Size

func (m *HttpReq) XXX_Size() int

func (*HttpReq) XXX_Unmarshal

func (m *HttpReq) XXX_Unmarshal(b []byte) error

type HttpRsp

type HttpRsp struct {
	Code                 int32    `protobuf:"varint,1,opt,name=code,proto3" json:"code,omitempty"`
	Msg                  string   `protobuf:"bytes,2,opt,name=msg,proto3" json:"msg,omitempty"`
	Reply                string   `protobuf:"bytes,3,opt,name=reply,proto3" json:"reply,omitempty"`
	XXX_NoUnkeyedLiteral struct{} `json:"-"`
	XXX_unrecognized     []byte   `json:"-"`
	XXX_sizecache        int32    `json:"-"`
}

func Call_HttpService_Call

func Call_HttpService_Call(ctx context.Context, in *HttpReq) (*HttpRsp, error)

func (*HttpRsp) Descriptor

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

func (*HttpRsp) GetCode

func (m *HttpRsp) GetCode() int32

func (*HttpRsp) GetMsg

func (m *HttpRsp) GetMsg() string

func (*HttpRsp) GetReply

func (m *HttpRsp) GetReply() string

func (*HttpRsp) ProtoMessage

func (*HttpRsp) ProtoMessage()

func (*HttpRsp) Reset

func (m *HttpRsp) Reset()

func (*HttpRsp) String

func (m *HttpRsp) String() string

func (*HttpRsp) XXX_DiscardUnknown

func (m *HttpRsp) XXX_DiscardUnknown()

func (*HttpRsp) XXX_Marshal

func (m *HttpRsp) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*HttpRsp) XXX_Merge

func (m *HttpRsp) XXX_Merge(src proto.Message)

func (*HttpRsp) XXX_Size

func (m *HttpRsp) XXX_Size() int

func (*HttpRsp) XXX_Unmarshal

func (m *HttpRsp) XXX_Unmarshal(b []byte) error

type HttpServiceClient

type HttpServiceClient interface {
	Call(ctx context.Context, in *HttpReq, opts ...grpc.CallOption) (*HttpRsp, error)
}

HttpServiceClient is the client API for HttpService service.

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

func NewHttpServiceClient

func NewHttpServiceClient(cc *grpc.ClientConn) HttpServiceClient

type HttpServiceServer

type HttpServiceServer interface {
	Call(context.Context, *HttpReq) (*HttpRsp, error)
}

HttpServiceServer is the server API for HttpService service.

type Logger

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

func NewLogger

func NewLogger(name string, env string) *Logger

type Server

type Server struct {
	Lis      net.Listener
	Etcd_cli *clientv3.Client
	Resolver *etcdnaming.GRPCResolver
	Addr     string
	Svr      *grpc.Server
	// contains filtered or unexported fields
}

func NewServer

func NewServer(name string) *Server

Jump to

Keyboard shortcuts

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