errapi

package
v0.0.0-...-ee57bd3 Latest Latest
Warning

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

Go to latest
Published: Apr 18, 2024 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var File_errapi_errapi_proto protoreflect.FileDescriptor

Functions

func NewXClientForErrAPI

func NewXClientForErrAPI(addr string) (client.XClient, error)

NewXClientForErrAPI creates a XClient. You can configure this client with more options such as etcd registry, serialize type, select algorithm and fail mode.

func RegisterErrAPIHTTPService

func RegisterErrAPIHTTPService(g *gin.RouterGroup, svc ErrAPIHTTPService)

Types

type ErrAPIAble

type ErrAPIAble interface {

	// SayHello is server rpc method as defined
	SayHello(ctx context.Context, args *HelloRequest, reply *HelloReply) (err error)

	// TestError is server rpc method as defined
	TestError(ctx context.Context, args *ErrorRequest, reply *ErrorReply) (err error)
}

================== interface skeleton ===================

type ErrAPIClient

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

================== client stub =================== ErrAPI is a client wrapped XClient.

func NewErrAPIClient

func NewErrAPIClient(xclient client.XClient) *ErrAPIClient

NewErrAPIClient wraps a XClient as ErrAPIClient. You can pass a shared XClient object created by NewXClientForErrAPI.

func (*ErrAPIClient) SayHello

func (c *ErrAPIClient) SayHello(ctx context.Context, args *HelloRequest) (reply *HelloReply, err error)

SayHello is client rpc method as defined

func (*ErrAPIClient) TestError

func (c *ErrAPIClient) TestError(ctx context.Context, args *ErrorRequest) (reply *ErrorReply, err error)

TestError is client rpc method as defined

type ErrAPIHTTPService

type ErrAPIHTTPService interface {
	// SayHello ...
	SayHello(context.Context, *HelloRequest) (*HelloReply, error)
	// TestError ...
	TestError(context.Context, *ErrorRequest) (*ErrorReply, error)
}

type ErrAPIOneClient

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

================== oneclient stub =================== ErrAPIOneClient is a client wrapped oneClient.

func NewErrAPIOneClient

func NewErrAPIOneClient(oneclient *client.OneClient) *ErrAPIOneClient

NewErrAPIOneClient wraps a OneClient as ErrAPIOneClient. You can pass a shared OneClient object created by NewOneClientForErrAPI.

func (*ErrAPIOneClient) SayHello

func (c *ErrAPIOneClient) SayHello(ctx context.Context, args *HelloRequest) (reply *HelloReply, err error)

SayHello is client rpc method as defined

func (*ErrAPIOneClient) TestError

func (c *ErrAPIOneClient) TestError(ctx context.Context, args *ErrorRequest) (reply *ErrorReply, err error)

TestError is client rpc method as defined

type ErrorReply

type ErrorReply struct {
	Message string `protobuf:"bytes,1,opt,name=message,proto3" json:"message,omitempty"`
	// contains filtered or unexported fields
}

func (*ErrorReply) Descriptor deprecated

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

Deprecated: Use ErrorReply.ProtoReflect.Descriptor instead.

func (*ErrorReply) GetMessage

func (x *ErrorReply) GetMessage() string

func (*ErrorReply) ProtoMessage

func (*ErrorReply) ProtoMessage()

func (*ErrorReply) ProtoReflect

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

func (*ErrorReply) Reset

func (x *ErrorReply) Reset()

func (*ErrorReply) String

func (x *ErrorReply) String() string

type ErrorRequest

type ErrorRequest struct {
	Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"`
	// contains filtered or unexported fields
}

func (*ErrorRequest) Descriptor deprecated

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

Deprecated: Use ErrorRequest.ProtoReflect.Descriptor instead.

func (*ErrorRequest) GetName

func (x *ErrorRequest) GetName() string

func (*ErrorRequest) ProtoMessage

func (*ErrorRequest) ProtoMessage()

func (*ErrorRequest) ProtoReflect

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

func (*ErrorRequest) Reset

func (x *ErrorRequest) Reset()

func (*ErrorRequest) String

func (x *ErrorRequest) String() string

type HelloReply

type HelloReply struct {
	Message string `protobuf:"bytes,1,opt,name=message,proto3" json:"message,omitempty"`
	// contains filtered or unexported fields
}

func (*HelloReply) Descriptor deprecated

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

Deprecated: Use HelloReply.ProtoReflect.Descriptor instead.

func (*HelloReply) GetMessage

func (x *HelloReply) GetMessage() string

func (*HelloReply) ProtoMessage

func (*HelloReply) ProtoMessage()

func (*HelloReply) ProtoReflect

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

func (*HelloReply) Reset

func (x *HelloReply) Reset()

func (*HelloReply) String

func (x *HelloReply) String() string

type HelloRequest

type HelloRequest struct {
	Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"`
	// contains filtered or unexported fields
}

func (*HelloRequest) Descriptor deprecated

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

Deprecated: Use HelloRequest.ProtoReflect.Descriptor instead.

func (*HelloRequest) GetName

func (x *HelloRequest) GetName() string

func (*HelloRequest) ProtoMessage

func (*HelloRequest) ProtoMessage()

func (*HelloRequest) ProtoReflect

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

func (*HelloRequest) Reset

func (x *HelloRequest) Reset()

func (*HelloRequest) String

func (x *HelloRequest) String() string

Jump to

Keyboard shortcuts

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