pb

package
v0.2.1 Latest Latest
Warning

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

Go to latest
Published: Jan 8, 2020 License: MIT Imports: 14 Imported by: 0

Documentation

Overview

Package pb is a reverse proxy.

It translates gRPC into RESTful JSON APIs.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func RegisterAuthHandler

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

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

func RegisterAuthHandlerClient added in v0.2.0

func RegisterAuthHandlerClient(ctx context.Context, mux *runtime.ServeMux, client AuthClient) error

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

func RegisterAuthHandlerFromEndpoint

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

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

func RegisterAuthHandlerServer added in v0.2.0

func RegisterAuthHandlerServer(ctx context.Context, mux *runtime.ServeMux, server AuthServer) error

RegisterAuthHandlerServer registers the http handlers for service Auth to "mux". UnaryRPC :call AuthServer directly. StreamingRPC :currently unsupported pending https://github.com/grpc/grpc-go/issues/906.

func RegisterAuthServer

func RegisterAuthServer(s *grpc.Server, srv AuthServer)

Types

type AuthClient

type AuthClient interface {
	Auth(ctx context.Context, in *AuthRequestMessage, opts ...grpc.CallOption) (*AuthResponseMessage, error)
}

AuthClient is the client API for Auth service.

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

func NewAuthClient

func NewAuthClient(cc *grpc.ClientConn) AuthClient

type AuthRequestMessage

type AuthRequestMessage struct {
	GrantType            string   `protobuf:"bytes,1,opt,name=grant_type,json=grantType,proto3" json:"grant_type,omitempty"`
	Username             string   `protobuf:"bytes,2,opt,name=username,proto3" json:"username,omitempty"`
	Password             string   `protobuf:"bytes,3,opt,name=password,proto3" json:"password,omitempty"`
	XXX_NoUnkeyedLiteral struct{} `json:"-"`
	XXX_unrecognized     []byte   `json:"-"`
	XXX_sizecache        int32    `json:"-"`
}

func (*AuthRequestMessage) Descriptor

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

func (*AuthRequestMessage) GetGrantType

func (m *AuthRequestMessage) GetGrantType() string

func (*AuthRequestMessage) GetPassword

func (m *AuthRequestMessage) GetPassword() string

func (*AuthRequestMessage) GetUsername

func (m *AuthRequestMessage) GetUsername() string

func (*AuthRequestMessage) ProtoMessage

func (*AuthRequestMessage) ProtoMessage()

func (*AuthRequestMessage) Reset

func (m *AuthRequestMessage) Reset()

func (*AuthRequestMessage) String

func (m *AuthRequestMessage) String() string

func (*AuthRequestMessage) XXX_DiscardUnknown added in v0.2.0

func (m *AuthRequestMessage) XXX_DiscardUnknown()

func (*AuthRequestMessage) XXX_Marshal added in v0.2.0

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

func (*AuthRequestMessage) XXX_Merge added in v0.2.0

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

func (*AuthRequestMessage) XXX_Size added in v0.2.0

func (m *AuthRequestMessage) XXX_Size() int

func (*AuthRequestMessage) XXX_Unmarshal added in v0.2.0

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

type AuthResponseMessage

type AuthResponseMessage struct {
	AccessToken          string   `protobuf:"bytes,1,opt,name=access_token,json=accessToken,proto3" json:"access_token,omitempty"`
	TokenType            string   `protobuf:"bytes,2,opt,name=token_type,json=tokenType,proto3" json:"token_type,omitempty"`
	ExpiresIn            int64    `protobuf:"varint,3,opt,name=expires_in,json=expiresIn,proto3" json:"expires_in,omitempty"`
	XXX_NoUnkeyedLiteral struct{} `json:"-"`
	XXX_unrecognized     []byte   `json:"-"`
	XXX_sizecache        int32    `json:"-"`
}

func (*AuthResponseMessage) Descriptor

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

func (*AuthResponseMessage) GetAccessToken

func (m *AuthResponseMessage) GetAccessToken() string

func (*AuthResponseMessage) GetExpiresIn

func (m *AuthResponseMessage) GetExpiresIn() int64

func (*AuthResponseMessage) GetTokenType

func (m *AuthResponseMessage) GetTokenType() string

func (*AuthResponseMessage) ProtoMessage

func (*AuthResponseMessage) ProtoMessage()

func (*AuthResponseMessage) Reset

func (m *AuthResponseMessage) Reset()

func (*AuthResponseMessage) String

func (m *AuthResponseMessage) String() string

func (*AuthResponseMessage) XXX_DiscardUnknown added in v0.2.0

func (m *AuthResponseMessage) XXX_DiscardUnknown()

func (*AuthResponseMessage) XXX_Marshal added in v0.2.0

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

func (*AuthResponseMessage) XXX_Merge added in v0.2.0

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

func (*AuthResponseMessage) XXX_Size added in v0.2.0

func (m *AuthResponseMessage) XXX_Size() int

func (*AuthResponseMessage) XXX_Unmarshal added in v0.2.0

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

type AuthServer

type AuthServer interface {
	Auth(context.Context, *AuthRequestMessage) (*AuthResponseMessage, error)
}

AuthServer is the server API for Auth service.

type UnimplementedAuthServer added in v0.2.0

type UnimplementedAuthServer struct {
}

UnimplementedAuthServer can be embedded to have forward compatible implementations.

func (*UnimplementedAuthServer) Auth added in v0.2.0

type UserMessage

type UserMessage struct {
	Id                   string   `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"`
	Username             string   `protobuf:"bytes,2,opt,name=username,proto3" json:"username,omitempty"`
	Password             string   `protobuf:"bytes,3,opt,name=password,proto3" json:"password,omitempty"`
	Name                 string   `protobuf:"bytes,4,opt,name=name,proto3" json:"name,omitempty"`
	Role                 string   `protobuf:"bytes,5,opt,name=role,proto3" json:"role,omitempty"`
	XXX_NoUnkeyedLiteral struct{} `json:"-"`
	XXX_unrecognized     []byte   `json:"-"`
	XXX_sizecache        int32    `json:"-"`
}

func (*UserMessage) Descriptor

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

func (*UserMessage) GetId

func (m *UserMessage) GetId() string

func (*UserMessage) GetName

func (m *UserMessage) GetName() string

func (*UserMessage) GetPassword

func (m *UserMessage) GetPassword() string

func (*UserMessage) GetRole

func (m *UserMessage) GetRole() string

func (*UserMessage) GetUsername

func (m *UserMessage) GetUsername() string

func (*UserMessage) ProtoMessage

func (*UserMessage) ProtoMessage()

func (*UserMessage) Reset

func (m *UserMessage) Reset()

func (*UserMessage) String

func (m *UserMessage) String() string

func (*UserMessage) XXX_DiscardUnknown added in v0.2.0

func (m *UserMessage) XXX_DiscardUnknown()

func (*UserMessage) XXX_Marshal added in v0.2.0

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

func (*UserMessage) XXX_Merge added in v0.2.0

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

func (*UserMessage) XXX_Size added in v0.2.0

func (m *UserMessage) XXX_Size() int

func (*UserMessage) XXX_Unmarshal added in v0.2.0

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

Jump to

Keyboard shortcuts

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