Documentation ¶
Overview ¶
Package api_v1_users is a reverse proxy.
It translates gRPC into RESTful JSON APIs.
Index ¶
- Variables
- func RegisterUsersAPIServiceHandler(ctx context.Context, mux *runtime.ServeMux, conn *grpc.ClientConn) error
- func RegisterUsersAPIServiceHandlerClient(ctx context.Context, mux *runtime.ServeMux, client UsersAPIServiceClient) error
- func RegisterUsersAPIServiceHandlerFromEndpoint(ctx context.Context, mux *runtime.ServeMux, endpoint string, ...) (err error)
- func RegisterUsersAPIServiceHandlerServer(ctx context.Context, mux *runtime.ServeMux, server UsersAPIServiceServer) error
- func RegisterUsersAPIServiceServer(s *grpc.Server, srv UsersAPIServiceServer)
- type AddRoleRequest
- func (*AddRoleRequest) Descriptor() ([]byte, []int)
- func (m *AddRoleRequest) GetRole() Role
- func (m *AddRoleRequest) GetUuid() string
- func (*AddRoleRequest) ProtoMessage()
- func (m *AddRoleRequest) Reset()
- func (m *AddRoleRequest) String() string
- func (this *AddRoleRequest) Validate() error
- func (m *AddRoleRequest) XXX_DiscardUnknown()
- func (m *AddRoleRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (m *AddRoleRequest) XXX_Merge(src proto.Message)
- func (m *AddRoleRequest) XXX_Size() int
- func (m *AddRoleRequest) XXX_Unmarshal(b []byte) error
- type AuthRequest
- func (*AuthRequest) Descriptor() ([]byte, []int)
- func (m *AuthRequest) GetEmail() string
- func (m *AuthRequest) GetPassword() string
- func (*AuthRequest) ProtoMessage()
- func (m *AuthRequest) Reset()
- func (m *AuthRequest) String() string
- func (this *AuthRequest) Validate() error
- func (m *AuthRequest) XXX_DiscardUnknown()
- func (m *AuthRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (m *AuthRequest) XXX_Merge(src proto.Message)
- func (m *AuthRequest) XXX_Size() int
- func (m *AuthRequest) XXX_Unmarshal(b []byte) error
- type AuthResponse
- func (*AuthResponse) Descriptor() ([]byte, []int)
- func (m *AuthResponse) GetErrors() []*Error
- func (m *AuthResponse) GetToken() string
- func (m *AuthResponse) GetValid() bool
- func (*AuthResponse) ProtoMessage()
- func (m *AuthResponse) Reset()
- func (m *AuthResponse) String() string
- func (this *AuthResponse) Validate() error
- func (m *AuthResponse) XXX_DiscardUnknown()
- func (m *AuthResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (m *AuthResponse) XXX_Merge(src proto.Message)
- func (m *AuthResponse) XXX_Size() int
- func (m *AuthResponse) XXX_Unmarshal(b []byte) error
- type CreateUserRequest
- func (*CreateUserRequest) Descriptor() ([]byte, []int)
- func (m *CreateUserRequest) GetCompany() string
- func (m *CreateUserRequest) GetEmail() string
- func (m *CreateUserRequest) GetPassword() string
- func (*CreateUserRequest) ProtoMessage()
- func (m *CreateUserRequest) Reset()
- func (m *CreateUserRequest) String() string
- func (this *CreateUserRequest) Validate() error
- func (m *CreateUserRequest) XXX_DiscardUnknown()
- func (m *CreateUserRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (m *CreateUserRequest) XXX_Merge(src proto.Message)
- func (m *CreateUserRequest) XXX_Size() int
- func (m *CreateUserRequest) XXX_Unmarshal(b []byte) error
- type CreateUserResponse
- func (*CreateUserResponse) Descriptor() ([]byte, []int)
- func (m *CreateUserResponse) GetStateCode() ResponseStateCode
- func (*CreateUserResponse) ProtoMessage()
- func (m *CreateUserResponse) Reset()
- func (m *CreateUserResponse) String() string
- func (this *CreateUserResponse) Validate() error
- func (m *CreateUserResponse) XXX_DiscardUnknown()
- func (m *CreateUserResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (m *CreateUserResponse) XXX_Merge(src proto.Message)
- func (m *CreateUserResponse) XXX_Size() int
- func (m *CreateUserResponse) XXX_Unmarshal(b []byte) error
- type Error
- func (*Error) Descriptor() ([]byte, []int)
- func (m *Error) GetCode() int32
- func (m *Error) GetDescription() string
- func (*Error) ProtoMessage()
- func (m *Error) Reset()
- func (m *Error) String() string
- func (this *Error) Validate() error
- func (m *Error) XXX_DiscardUnknown()
- func (m *Error) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (m *Error) XXX_Merge(src proto.Message)
- func (m *Error) XXX_Size() int
- func (m *Error) XXX_Unmarshal(b []byte) error
- type ResponseStateCode
- type Role
- type UnimplementedUsersAPIServiceServer
- func (*UnimplementedUsersAPIServiceServer) AddRole(ctx context.Context, req *AddRoleRequest) (*empty.Empty, error)
- func (*UnimplementedUsersAPIServiceServer) Auth(ctx context.Context, req *AuthRequest) (*AuthResponse, error)
- func (*UnimplementedUsersAPIServiceServer) CreateUser(ctx context.Context, req *CreateUserRequest) (*CreateUserResponse, error)
- type UsersAPIServiceClient
- type UsersAPIServiceServer
Constants ¶
This section is empty.
Variables ¶
var ResponseStateCode_name = map[int32]string{
0: "CREATED",
}
var ResponseStateCode_value = map[string]int32{
"CREATED": 0,
}
var Role_name = map[int32]string{
0: "UNKNOWN",
1: "USER",
2: "USER_ADMIN",
}
var Role_value = map[string]int32{
"UNKNOWN": 0,
"USER": 1,
"USER_ADMIN": 2,
}
Functions ¶
func RegisterUsersAPIServiceHandler ¶
func RegisterUsersAPIServiceHandler(ctx context.Context, mux *runtime.ServeMux, conn *grpc.ClientConn) error
RegisterUsersAPIServiceHandler registers the http handlers for service UsersAPIService to "mux". The handlers forward requests to the grpc endpoint over "conn".
func RegisterUsersAPIServiceHandlerClient ¶
func RegisterUsersAPIServiceHandlerClient(ctx context.Context, mux *runtime.ServeMux, client UsersAPIServiceClient) error
RegisterUsersAPIServiceHandlerClient registers the http handlers for service UsersAPIService to "mux". The handlers forward requests to the grpc endpoint over the given implementation of "UsersAPIServiceClient". Note: the gRPC framework executes interceptors within the gRPC handler. If the passed in "UsersAPIServiceClient" doesn't go through the normal gRPC flow (creating a gRPC client etc.) then it will be up to the passed in "UsersAPIServiceClient" to call the correct interceptors.
func RegisterUsersAPIServiceHandlerFromEndpoint ¶
func RegisterUsersAPIServiceHandlerFromEndpoint(ctx context.Context, mux *runtime.ServeMux, endpoint string, opts []grpc.DialOption) (err error)
RegisterUsersAPIServiceHandlerFromEndpoint is same as RegisterUsersAPIServiceHandler but automatically dials to "endpoint" and closes the connection when "ctx" gets done.
func RegisterUsersAPIServiceHandlerServer ¶
func RegisterUsersAPIServiceHandlerServer(ctx context.Context, mux *runtime.ServeMux, server UsersAPIServiceServer) error
RegisterUsersAPIServiceHandlerServer registers the http handlers for service UsersAPIService to "mux". UnaryRPC :call UsersAPIServiceServer directly. StreamingRPC :currently unsupported pending https://github.com/grpc/grpc-go/issues/906.
func RegisterUsersAPIServiceServer ¶
func RegisterUsersAPIServiceServer(s *grpc.Server, srv UsersAPIServiceServer)
Types ¶
type AddRoleRequest ¶
type AddRoleRequest struct { Uuid string `protobuf:"bytes,1,opt,name=uuid,proto3" json:"uuid,omitempty"` Role Role `protobuf:"varint,2,opt,name=role,proto3,enum=api.v1.users.Role" json:"role,omitempty"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_unrecognized []byte `json:"-"` XXX_sizecache int32 `json:"-"` }
func (*AddRoleRequest) Descriptor ¶
func (*AddRoleRequest) Descriptor() ([]byte, []int)
func (*AddRoleRequest) GetRole ¶
func (m *AddRoleRequest) GetRole() Role
func (*AddRoleRequest) GetUuid ¶
func (m *AddRoleRequest) GetUuid() string
func (*AddRoleRequest) ProtoMessage ¶
func (*AddRoleRequest) ProtoMessage()
func (*AddRoleRequest) Reset ¶
func (m *AddRoleRequest) Reset()
func (*AddRoleRequest) String ¶
func (m *AddRoleRequest) String() string
func (*AddRoleRequest) Validate ¶
func (this *AddRoleRequest) Validate() error
func (*AddRoleRequest) XXX_DiscardUnknown ¶
func (m *AddRoleRequest) XXX_DiscardUnknown()
func (*AddRoleRequest) XXX_Marshal ¶
func (m *AddRoleRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
func (*AddRoleRequest) XXX_Merge ¶
func (m *AddRoleRequest) XXX_Merge(src proto.Message)
func (*AddRoleRequest) XXX_Size ¶
func (m *AddRoleRequest) XXX_Size() int
func (*AddRoleRequest) XXX_Unmarshal ¶
func (m *AddRoleRequest) XXX_Unmarshal(b []byte) error
type AuthRequest ¶
type AuthRequest struct { Email string `protobuf:"bytes,1,opt,name=email,proto3" json:"email,omitempty"` Password string `protobuf:"bytes,2,opt,name=password,proto3" json:"password,omitempty"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_unrecognized []byte `json:"-"` XXX_sizecache int32 `json:"-"` }
func (*AuthRequest) Descriptor ¶
func (*AuthRequest) Descriptor() ([]byte, []int)
func (*AuthRequest) GetEmail ¶
func (m *AuthRequest) GetEmail() string
func (*AuthRequest) GetPassword ¶
func (m *AuthRequest) GetPassword() string
func (*AuthRequest) ProtoMessage ¶
func (*AuthRequest) ProtoMessage()
func (*AuthRequest) Reset ¶
func (m *AuthRequest) Reset()
func (*AuthRequest) String ¶
func (m *AuthRequest) String() string
func (*AuthRequest) Validate ¶
func (this *AuthRequest) Validate() error
func (*AuthRequest) XXX_DiscardUnknown ¶
func (m *AuthRequest) XXX_DiscardUnknown()
func (*AuthRequest) XXX_Marshal ¶
func (m *AuthRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
func (*AuthRequest) XXX_Merge ¶
func (m *AuthRequest) XXX_Merge(src proto.Message)
func (*AuthRequest) XXX_Size ¶
func (m *AuthRequest) XXX_Size() int
func (*AuthRequest) XXX_Unmarshal ¶
func (m *AuthRequest) XXX_Unmarshal(b []byte) error
type AuthResponse ¶
type AuthResponse struct { Token string `protobuf:"bytes,1,opt,name=token,proto3" json:"token,omitempty"` Valid bool `protobuf:"varint,2,opt,name=valid,proto3" json:"valid,omitempty"` Errors []*Error `protobuf:"bytes,3,rep,name=errors,proto3" json:"errors,omitempty"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_unrecognized []byte `json:"-"` XXX_sizecache int32 `json:"-"` }
func (*AuthResponse) Descriptor ¶
func (*AuthResponse) Descriptor() ([]byte, []int)
func (*AuthResponse) GetErrors ¶
func (m *AuthResponse) GetErrors() []*Error
func (*AuthResponse) GetToken ¶
func (m *AuthResponse) GetToken() string
func (*AuthResponse) GetValid ¶
func (m *AuthResponse) GetValid() bool
func (*AuthResponse) ProtoMessage ¶
func (*AuthResponse) ProtoMessage()
func (*AuthResponse) Reset ¶
func (m *AuthResponse) Reset()
func (*AuthResponse) String ¶
func (m *AuthResponse) String() string
func (*AuthResponse) Validate ¶
func (this *AuthResponse) Validate() error
func (*AuthResponse) XXX_DiscardUnknown ¶
func (m *AuthResponse) XXX_DiscardUnknown()
func (*AuthResponse) XXX_Marshal ¶
func (m *AuthResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
func (*AuthResponse) XXX_Merge ¶
func (m *AuthResponse) XXX_Merge(src proto.Message)
func (*AuthResponse) XXX_Size ¶
func (m *AuthResponse) XXX_Size() int
func (*AuthResponse) XXX_Unmarshal ¶
func (m *AuthResponse) XXX_Unmarshal(b []byte) error
type CreateUserRequest ¶
type CreateUserRequest struct { Email string `protobuf:"bytes,1,opt,name=email,proto3" json:"email,omitempty"` Password string `protobuf:"bytes,2,opt,name=password,proto3" json:"password,omitempty"` Company string `protobuf:"bytes,3,opt,name=company,proto3" json:"company,omitempty"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_unrecognized []byte `json:"-"` XXX_sizecache int32 `json:"-"` }
func (*CreateUserRequest) Descriptor ¶
func (*CreateUserRequest) Descriptor() ([]byte, []int)
func (*CreateUserRequest) GetCompany ¶
func (m *CreateUserRequest) GetCompany() string
func (*CreateUserRequest) GetEmail ¶
func (m *CreateUserRequest) GetEmail() string
func (*CreateUserRequest) GetPassword ¶
func (m *CreateUserRequest) GetPassword() string
func (*CreateUserRequest) ProtoMessage ¶
func (*CreateUserRequest) ProtoMessage()
func (*CreateUserRequest) Reset ¶
func (m *CreateUserRequest) Reset()
func (*CreateUserRequest) String ¶
func (m *CreateUserRequest) String() string
func (*CreateUserRequest) Validate ¶
func (this *CreateUserRequest) Validate() error
func (*CreateUserRequest) XXX_DiscardUnknown ¶
func (m *CreateUserRequest) XXX_DiscardUnknown()
func (*CreateUserRequest) XXX_Marshal ¶
func (m *CreateUserRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
func (*CreateUserRequest) XXX_Merge ¶
func (m *CreateUserRequest) XXX_Merge(src proto.Message)
func (*CreateUserRequest) XXX_Size ¶
func (m *CreateUserRequest) XXX_Size() int
func (*CreateUserRequest) XXX_Unmarshal ¶
func (m *CreateUserRequest) XXX_Unmarshal(b []byte) error
type CreateUserResponse ¶
type CreateUserResponse struct { StateCode ResponseStateCode `protobuf:"varint,1,opt,name=stateCode,proto3,enum=api.v1.users.ResponseStateCode" json:"stateCode,omitempty"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_unrecognized []byte `json:"-"` XXX_sizecache int32 `json:"-"` }
func (*CreateUserResponse) Descriptor ¶
func (*CreateUserResponse) Descriptor() ([]byte, []int)
func (*CreateUserResponse) GetStateCode ¶
func (m *CreateUserResponse) GetStateCode() ResponseStateCode
func (*CreateUserResponse) ProtoMessage ¶
func (*CreateUserResponse) ProtoMessage()
func (*CreateUserResponse) Reset ¶
func (m *CreateUserResponse) Reset()
func (*CreateUserResponse) String ¶
func (m *CreateUserResponse) String() string
func (*CreateUserResponse) Validate ¶
func (this *CreateUserResponse) Validate() error
func (*CreateUserResponse) XXX_DiscardUnknown ¶
func (m *CreateUserResponse) XXX_DiscardUnknown()
func (*CreateUserResponse) XXX_Marshal ¶
func (m *CreateUserResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
func (*CreateUserResponse) XXX_Merge ¶
func (m *CreateUserResponse) XXX_Merge(src proto.Message)
func (*CreateUserResponse) XXX_Size ¶
func (m *CreateUserResponse) XXX_Size() int
func (*CreateUserResponse) XXX_Unmarshal ¶
func (m *CreateUserResponse) XXX_Unmarshal(b []byte) error
type Error ¶
type Error struct { Code int32 `protobuf:"varint,1,opt,name=code,proto3" json:"code,omitempty"` Description string `protobuf:"bytes,2,opt,name=description,proto3" json:"description,omitempty"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_unrecognized []byte `json:"-"` XXX_sizecache int32 `json:"-"` }
func (*Error) Descriptor ¶
func (*Error) GetDescription ¶
func (*Error) ProtoMessage ¶
func (*Error) ProtoMessage()
func (*Error) XXX_DiscardUnknown ¶
func (m *Error) XXX_DiscardUnknown()
func (*Error) XXX_Marshal ¶
func (*Error) XXX_Unmarshal ¶
type ResponseStateCode ¶
type ResponseStateCode int32
const (
ResponseStateCode_CREATED ResponseStateCode = 0
)
func (ResponseStateCode) EnumDescriptor ¶
func (ResponseStateCode) EnumDescriptor() ([]byte, []int)
func (ResponseStateCode) String ¶
func (x ResponseStateCode) String() string
type UnimplementedUsersAPIServiceServer ¶
type UnimplementedUsersAPIServiceServer struct { }
UnimplementedUsersAPIServiceServer can be embedded to have forward compatible implementations.
func (*UnimplementedUsersAPIServiceServer) AddRole ¶
func (*UnimplementedUsersAPIServiceServer) AddRole(ctx context.Context, req *AddRoleRequest) (*empty.Empty, error)
func (*UnimplementedUsersAPIServiceServer) Auth ¶
func (*UnimplementedUsersAPIServiceServer) Auth(ctx context.Context, req *AuthRequest) (*AuthResponse, error)
func (*UnimplementedUsersAPIServiceServer) CreateUser ¶
func (*UnimplementedUsersAPIServiceServer) CreateUser(ctx context.Context, req *CreateUserRequest) (*CreateUserResponse, error)
type UsersAPIServiceClient ¶
type UsersAPIServiceClient interface { CreateUser(ctx context.Context, in *CreateUserRequest, opts ...grpc.CallOption) (*CreateUserResponse, error) Auth(ctx context.Context, in *AuthRequest, opts ...grpc.CallOption) (*AuthResponse, error) AddRole(ctx context.Context, in *AddRoleRequest, opts ...grpc.CallOption) (*empty.Empty, error) }
UsersAPIServiceClient is the client API for UsersAPIService service.
For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream.
func NewUsersAPIServiceClient ¶
func NewUsersAPIServiceClient(cc *grpc.ClientConn) UsersAPIServiceClient
type UsersAPIServiceServer ¶
type UsersAPIServiceServer interface { CreateUser(context.Context, *CreateUserRequest) (*CreateUserResponse, error) Auth(context.Context, *AuthRequest) (*AuthResponse, error) AddRole(context.Context, *AddRoleRequest) (*empty.Empty, error) }
UsersAPIServiceServer is the server API for UsersAPIService service.