service

package
v0.0.0-...-51139a6 Latest Latest
Warning

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

Go to latest
Published: May 12, 2020 License: MIT Imports: 14 Imported by: 0

Documentation

Overview

Package account is a reverse proxy.

It translates gRPC into RESTful JSON APIs.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func RegisterAccountCreatorHandler

func RegisterAccountCreatorHandler(ctx context.Context, mux *runtime.ServeMux, conn *grpc.ClientConn) error

RegisterAccountCreatorHandler registers the http handlers for service AccountCreator to "mux". The handlers forward requests to the grpc endpoint over "conn".

func RegisterAccountCreatorHandlerClient

func RegisterAccountCreatorHandlerClient(ctx context.Context, mux *runtime.ServeMux, client AccountCreatorClient) error

RegisterAccountCreatorHandlerClient registers the http handlers for service AccountCreator to "mux". The handlers forward requests to the grpc endpoint over the given implementation of "AccountCreatorClient". Note: the gRPC framework executes interceptors within the gRPC handler. If the passed in "AccountCreatorClient" doesn't go through the normal gRPC flow (creating a gRPC client etc.) then it will be up to the passed in "AccountCreatorClient" to call the correct interceptors.

func RegisterAccountCreatorHandlerFromEndpoint

func RegisterAccountCreatorHandlerFromEndpoint(ctx context.Context, mux *runtime.ServeMux, endpoint string, opts []grpc.DialOption) (err error)

RegisterAccountCreatorHandlerFromEndpoint is same as RegisterAccountCreatorHandler but automatically dials to "endpoint" and closes the connection when "ctx" gets done.

func RegisterAccountCreatorServer

func RegisterAccountCreatorServer(s *grpc.Server, srv AccountCreatorServer)

Types

type AccountCreatorClient

type AccountCreatorClient interface {
	//定义一个rpc方法,指定请求和响应类型。
	CreateAccount(ctx context.Context, in *AccountRegister, opts ...grpc.CallOption) (*RegisterStatus, error)
}

AccountCreatorClient is the client API for AccountCreator service.

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

func NewAccountCreatorClient

func NewAccountCreatorClient(cc *grpc.ClientConn) AccountCreatorClient

type AccountCreatorServer

type AccountCreatorServer interface {
	//定义一个rpc方法,指定请求和响应类型。
	CreateAccount(context.Context, *AccountRegister) (*RegisterStatus, error)
}

AccountCreatorServer is the server API for AccountCreator service.

type AccountRegister

type AccountRegister struct {
	Username             string   `protobuf:"bytes,1,opt,name=username,proto3" json:"username,omitempty"`
	Email                string   `protobuf:"bytes,2,opt,name=email,proto3" json:"email,omitempty"`
	XXX_NoUnkeyedLiteral struct{} `json:"-"`
	XXX_unrecognized     []byte   `json:"-"`
	XXX_sizecache        int32    `json:"-"`
}

func (*AccountRegister) Descriptor

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

func (*AccountRegister) GetEmail

func (m *AccountRegister) GetEmail() string

func (*AccountRegister) GetUsername

func (m *AccountRegister) GetUsername() string

func (*AccountRegister) ProtoMessage

func (*AccountRegister) ProtoMessage()

func (*AccountRegister) Reset

func (m *AccountRegister) Reset()

func (*AccountRegister) String

func (m *AccountRegister) String() string

func (*AccountRegister) XXX_DiscardUnknown

func (m *AccountRegister) XXX_DiscardUnknown()

func (*AccountRegister) XXX_Marshal

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

func (*AccountRegister) XXX_Merge

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

func (*AccountRegister) XXX_Size

func (m *AccountRegister) XXX_Size() int

func (*AccountRegister) XXX_Unmarshal

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

type RegisterStatus

type RegisterStatus struct {
	Status               string   `protobuf:"bytes,3,opt,name=status,proto3" json:"status,omitempty"`
	XXX_NoUnkeyedLiteral struct{} `json:"-"`
	XXX_unrecognized     []byte   `json:"-"`
	XXX_sizecache        int32    `json:"-"`
}

func (*RegisterStatus) Descriptor

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

func (*RegisterStatus) GetStatus

func (m *RegisterStatus) GetStatus() string

func (*RegisterStatus) ProtoMessage

func (*RegisterStatus) ProtoMessage()

func (*RegisterStatus) Reset

func (m *RegisterStatus) Reset()

func (*RegisterStatus) String

func (m *RegisterStatus) String() string

func (*RegisterStatus) XXX_DiscardUnknown

func (m *RegisterStatus) XXX_DiscardUnknown()

func (*RegisterStatus) XXX_Marshal

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

func (*RegisterStatus) XXX_Merge

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

func (*RegisterStatus) XXX_Size

func (m *RegisterStatus) XXX_Size() int

func (*RegisterStatus) XXX_Unmarshal

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

Jump to

Keyboard shortcuts

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