api_v1_users

package
v0.0.0-...-17e45d3 Latest Latest
Warning

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

Go to latest
Published: Jun 13, 2020 License: MIT Imports: 17 Imported by: 0

Documentation

Overview

Package api_v1_users is a reverse proxy.

It translates gRPC into RESTful JSON APIs.

Index

Constants

This section is empty.

Variables

View Source
var ResponseStateCode_name = map[int32]string{
	0: "CREATED",
}
View Source
var ResponseStateCode_value = map[string]int32{
	"CREATED": 0,
}
View Source
var Role_name = map[int32]string{
	0: "UNKNOWN",
	1: "USER",
	2: "USER_ADMIN",
}
View Source
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) Descriptor() ([]byte, []int)

func (*Error) GetCode

func (m *Error) GetCode() int32

func (*Error) GetDescription

func (m *Error) GetDescription() string

func (*Error) ProtoMessage

func (*Error) ProtoMessage()

func (*Error) Reset

func (m *Error) Reset()

func (*Error) String

func (m *Error) String() string

func (*Error) Validate

func (this *Error) Validate() error

func (*Error) XXX_DiscardUnknown

func (m *Error) XXX_DiscardUnknown()

func (*Error) XXX_Marshal

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

func (*Error) XXX_Merge

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

func (*Error) XXX_Size

func (m *Error) XXX_Size() int

func (*Error) XXX_Unmarshal

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

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 Role

type Role int32
const (
	Role_UNKNOWN    Role = 0
	Role_USER       Role = 1
	Role_USER_ADMIN Role = 2
)

func (Role) EnumDescriptor

func (Role) EnumDescriptor() ([]byte, []int)

func (Role) String

func (x Role) String() string

type UnimplementedUsersAPIServiceServer

type UnimplementedUsersAPIServiceServer struct {
}

UnimplementedUsersAPIServiceServer can be embedded to have forward compatible implementations.

func (*UnimplementedUsersAPIServiceServer) AddRole

func (*UnimplementedUsersAPIServiceServer) Auth

func (*UnimplementedUsersAPIServiceServer) CreateUser

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.

Jump to

Keyboard shortcuts

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