Documentation ¶
Overview ¶
Code generated by protoc-gen-cdd. DO NOT EDIT. source: province.proto
Package province is a reverse proxy.
It translates gRPC into RESTful JSON APIs.
Index ¶
- Variables
- func RegisterProvinceGrstServer(grpcRestServer *grst.Server, hndl ProvinceServer)
- func RegisterProvinceHandler(ctx context.Context, mux *runtime.ServeMux, conn *grpc.ClientConn) error
- func RegisterProvinceHandlerClient(ctx context.Context, mux *runtime.ServeMux, client ProvinceClient) error
- func RegisterProvinceHandlerFromEndpoint(ctx context.Context, mux *runtime.ServeMux, endpoint string, ...) (err error)
- func RegisterProvinceHandlerServer(ctx context.Context, mux *runtime.ServeMux, server ProvinceServer) error
- func RegisterProvinceServer(s *grpc.Server, srv ProvinceServer)
- func ValidateRequest(req interface{}) error
- type AuthConfig
- type GetReq
- type Province
- type ProvinceClient
- type ProvinceServer
- type Provinces
- type UnimplementedProvinceServer
- type UnsafeProvinceServer
Constants ¶
This section is empty.
Variables ¶
var AuthConfigFullMethods = map[string]AuthConfig{ "/province.province/Get": AuthConfig{NeedAuth: true, Roles: []string{"admin", "employee"}}, "/province.province/GetAll": AuthConfig{NeedAuth: false, Roles: []string{"*"}}, }
var File_province_proto protoreflect.FileDescriptor
var FullMethods = fullMethods{
Province_Get: "/province.province/Get",
Province_GetAll: "/province.province/GetAll",
}
var NeedApiKeyFullMethods = []string{}
var NeedAuthFullMethods = []string{
"/province.province/Get",
}
Functions ¶
func RegisterProvinceGrstServer ¶
func RegisterProvinceGrstServer(grpcRestServer *grst.Server, hndl ProvinceServer)
func RegisterProvinceHandler ¶
func RegisterProvinceHandler(ctx context.Context, mux *runtime.ServeMux, conn *grpc.ClientConn) error
RegisterProvinceHandler registers the http handlers for service Province to "mux". The handlers forward requests to the grpc endpoint over "conn".
func RegisterProvinceHandlerClient ¶
func RegisterProvinceHandlerClient(ctx context.Context, mux *runtime.ServeMux, client ProvinceClient) error
RegisterProvinceHandlerClient registers the http handlers for service Province to "mux". The handlers forward requests to the grpc endpoint over the given implementation of "ProvinceClient". Note: the gRPC framework executes interceptors within the gRPC handler. If the passed in "ProvinceClient" doesn't go through the normal gRPC flow (creating a gRPC client etc.) then it will be up to the passed in "ProvinceClient" to call the correct interceptors.
func RegisterProvinceHandlerFromEndpoint ¶
func RegisterProvinceHandlerFromEndpoint(ctx context.Context, mux *runtime.ServeMux, endpoint string, opts []grpc.DialOption) (err error)
RegisterProvinceHandlerFromEndpoint is same as RegisterProvinceHandler but automatically dials to "endpoint" and closes the connection when "ctx" gets done.
func RegisterProvinceHandlerServer ¶
func RegisterProvinceHandlerServer(ctx context.Context, mux *runtime.ServeMux, server ProvinceServer) error
RegisterProvinceHandlerServer registers the http handlers for service Province to "mux". UnaryRPC :call ProvinceServer 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 RegisterProvinceHandlerFromEndpoint instead.
func RegisterProvinceServer ¶
func RegisterProvinceServer(s *grpc.Server, srv ProvinceServer)
func ValidateRequest ¶
func ValidateRequest(req interface{}) error
Types ¶
type AuthConfig ¶
type GetReq ¶
type GetReq struct { Id int32 `protobuf:"varint,1,opt,name=Id,json=id,proto3" json:"id,omitempty" validate:"required" default:"1"` // contains filtered or unexported fields }
func (*GetReq) Descriptor
deprecated
func (*GetReq) ProtoMessage ¶
func (*GetReq) ProtoMessage()
func (*GetReq) ProtoReflect ¶
func (x *GetReq) ProtoReflect() protoreflect.Message
type Province ¶
type Province struct { Id int32 `protobuf:"varint,1,opt,name=Id,json=id,proto3" json:"id,omitempty"` Name string `protobuf:"bytes,2,opt,name=Name,json=name,proto3" json:"name,omitempty"` // contains filtered or unexported fields }
func (*Province) Descriptor
deprecated
func (*Province) ProtoMessage ¶
func (*Province) ProtoMessage()
func (*Province) ProtoReflect ¶
func (x *Province) ProtoReflect() protoreflect.Message
type ProvinceClient ¶
type ProvinceClient interface { Get(ctx context.Context, in *GetReq, opts ...grpc.CallOption) (*Province, error) GetAll(ctx context.Context, in *empty.Empty, opts ...grpc.CallOption) (*Provinces, error) }
ProvinceClient is the client API for Province 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 NewProvinceClient ¶
func NewProvinceClient(cc grpc.ClientConnInterface) ProvinceClient
func NewProvinceGrstClient ¶
func NewProvinceGrstClient(serverHost string, creds *credentials.TransportCredentials, dialOpts ...grpc.DialOption) (ProvinceClient, error)
type ProvinceServer ¶
type ProvinceServer interface { Get(context.Context, *GetReq) (*Province, error) GetAll(context.Context, *empty.Empty) (*Provinces, error) // contains filtered or unexported methods }
ProvinceServer is the server API for Province service. All implementations must embed UnimplementedProvinceServer for forward compatibility
type Provinces ¶
type Provinces struct { Provinces []*Province `protobuf:"bytes,1,rep,name=Provinces,json=provinces,proto3" json:"provinces,omitempty"` // contains filtered or unexported fields }
func (*Provinces) Descriptor
deprecated
func (*Provinces) GetProvinces ¶
func (*Provinces) ProtoMessage ¶
func (*Provinces) ProtoMessage()
func (*Provinces) ProtoReflect ¶
func (x *Provinces) ProtoReflect() protoreflect.Message
type UnimplementedProvinceServer ¶
type UnimplementedProvinceServer struct { }
UnimplementedProvinceServer must be embedded to have forward compatible implementations.
type UnsafeProvinceServer ¶
type UnsafeProvinceServer interface {
// contains filtered or unexported methods
}
UnsafeProvinceServer may be embedded to opt out of forward compatibility for this service. Use of this interface is not recommended, as added methods to ProvinceServer will result in compilation errors.