accounts

package
v0.0.0-...-fe3a3ad Latest Latest
Warning

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

Go to latest
Published: Apr 16, 2021 License: MIT Imports: 16 Imported by: 0

Documentation

Overview

Package accounts is a reverse proxy.

It translates gRPC into RESTful JSON APIs.

Index

Constants

This section is empty.

Variables

View Source
var Accounts_ServiceDesc = grpc.ServiceDesc{
	ServiceName: "api.accounts.Accounts",
	HandlerType: (*AccountsServer)(nil),
	Methods: []grpc.MethodDesc{
		{
			MethodName: "Create",
			Handler:    _Accounts_Create_Handler,
		},
		{
			MethodName: "Get",
			Handler:    _Accounts_Get_Handler,
		},
	},
	Streams:  []grpc.StreamDesc{},
	Metadata: "api/accounts/accounts.proto",
}

Accounts_ServiceDesc is the grpc.ServiceDesc for Accounts service. It's only intended for direct use with grpc.RegisterService, and not to be introspected or modified (even as a copy)

View Source
var File_api_accounts_accounts_proto protoreflect.FileDescriptor

Functions

func RegisterAccountsHandler

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

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

func RegisterAccountsHandlerClient

func RegisterAccountsHandlerClient(ctx context.Context, mux *runtime.ServeMux, client AccountsClient) error

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

func RegisterAccountsHandlerFromEndpoint

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

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

func RegisterAccountsHandlerServer

func RegisterAccountsHandlerServer(ctx context.Context, mux *runtime.ServeMux, server AccountsServer) error

RegisterAccountsHandlerServer registers the http handlers for service Accounts to "mux". UnaryRPC :call AccountsServer directly. StreamingRPC :currently unsupported pending https://github.com/grpc/grpc-go/issues/906. Note that using this registration option will cause many gRPC library features to stop working. Consider using RegisterAccountsHandlerFromEndpoint instead.

func RegisterAccountsServer

func RegisterAccountsServer(s grpc.ServiceRegistrar, srv AccountsServer)

Types

type Account

type Account struct {
	Id        string               `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"`
	Email     string               `protobuf:"bytes,2,opt,name=email,proto3" json:"email,omitempty"`
	RealName  string               `protobuf:"bytes,3,opt,name=real_name,json=realName,proto3" json:"real_name,omitempty"`
	CreatedAt *timestamp.Timestamp `protobuf:"bytes,1000,opt,name=created_at,json=createdAt,proto3" json:"created_at,omitempty"`
	UpdatedAt *timestamp.Timestamp `protobuf:"bytes,1001,opt,name=updated_at,json=updatedAt,proto3" json:"updated_at,omitempty"`
	// contains filtered or unexported fields
}

func (*Account) Descriptor deprecated

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

Deprecated: Use Account.ProtoReflect.Descriptor instead.

func (*Account) GetCreatedAt

func (x *Account) GetCreatedAt() *timestamp.Timestamp

func (*Account) GetEmail

func (x *Account) GetEmail() string

func (*Account) GetId

func (x *Account) GetId() string

func (*Account) GetRealName

func (x *Account) GetRealName() string

func (*Account) GetUpdatedAt

func (x *Account) GetUpdatedAt() *timestamp.Timestamp

func (*Account) ProtoMessage

func (*Account) ProtoMessage()

func (*Account) ProtoReflect

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

func (*Account) Reset

func (x *Account) Reset()

func (*Account) String

func (x *Account) String() string

type AccountsClient

type AccountsClient interface {
	Create(ctx context.Context, in *CreateRequest, opts ...grpc.CallOption) (*CreateResponse, error)
	Get(ctx context.Context, in *GetRequest, opts ...grpc.CallOption) (*GetResponse, error)
}

AccountsClient is the client API for Accounts service.

For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream.

func NewAccountsClient

func NewAccountsClient(cc grpc.ClientConnInterface) AccountsClient

type AccountsServer

type AccountsServer interface {
	Create(context.Context, *CreateRequest) (*CreateResponse, error)
	Get(context.Context, *GetRequest) (*GetResponse, error)
	// contains filtered or unexported methods
}

AccountsServer is the server API for Accounts service. All implementations must embed UnimplementedAccountsServer for forward compatibility

type CreateRequest

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

func (*CreateRequest) Descriptor deprecated

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

Deprecated: Use CreateRequest.ProtoReflect.Descriptor instead.

func (*CreateRequest) GetGithubAccessToken

func (x *CreateRequest) GetGithubAccessToken() string

func (*CreateRequest) ProtoMessage

func (*CreateRequest) ProtoMessage()

func (*CreateRequest) ProtoReflect

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

func (*CreateRequest) Reset

func (x *CreateRequest) Reset()

func (*CreateRequest) String

func (x *CreateRequest) String() string

type CreateResponse

type CreateResponse struct {
	Account *Account `protobuf:"bytes,1,opt,name=account,proto3" json:"account,omitempty"`
	// contains filtered or unexported fields
}

func (*CreateResponse) Descriptor deprecated

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

Deprecated: Use CreateResponse.ProtoReflect.Descriptor instead.

func (*CreateResponse) GetAccount

func (x *CreateResponse) GetAccount() *Account

func (*CreateResponse) ProtoMessage

func (*CreateResponse) ProtoMessage()

func (*CreateResponse) ProtoReflect

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

func (*CreateResponse) Reset

func (x *CreateResponse) Reset()

func (*CreateResponse) String

func (x *CreateResponse) String() string

type GetRequest

type GetRequest struct {
	Ids []string `protobuf:"bytes,1,rep,name=ids,proto3" json:"ids,omitempty"`
	// contains filtered or unexported fields
}

func (*GetRequest) Descriptor deprecated

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

Deprecated: Use GetRequest.ProtoReflect.Descriptor instead.

func (*GetRequest) GetIds

func (x *GetRequest) GetIds() []string

func (*GetRequest) ProtoMessage

func (*GetRequest) ProtoMessage()

func (*GetRequest) ProtoReflect

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

func (*GetRequest) Reset

func (x *GetRequest) Reset()

func (*GetRequest) String

func (x *GetRequest) String() string

type GetResponse

type GetResponse struct {
	Accounts map[string]*Account `` /* 157-byte string literal not displayed */
	// contains filtered or unexported fields
}

func (*GetResponse) Descriptor deprecated

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

Deprecated: Use GetResponse.ProtoReflect.Descriptor instead.

func (*GetResponse) GetAccounts

func (x *GetResponse) GetAccounts() map[string]*Account

func (*GetResponse) ProtoMessage

func (*GetResponse) ProtoMessage()

func (*GetResponse) ProtoReflect

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

func (*GetResponse) Reset

func (x *GetResponse) Reset()

func (*GetResponse) String

func (x *GetResponse) String() string

type UnimplementedAccountsServer

type UnimplementedAccountsServer struct {
}

UnimplementedAccountsServer must be embedded to have forward compatible implementations.

func (UnimplementedAccountsServer) Create

func (UnimplementedAccountsServer) Get

type UnsafeAccountsServer

type UnsafeAccountsServer interface {
	// contains filtered or unexported methods
}

UnsafeAccountsServer may be embedded to opt out of forward compatibility for this service. Use of this interface is not recommended, as added methods to AccountsServer will result in compilation errors.

Jump to

Keyboard shortcuts

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