province

package
v0.0.0-...-da4b49c Latest Latest
Warning

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

Go to latest
Published: Jul 18, 2023 License: BSD-3-Clause Imports: 25 Imported by: 0

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

Constants

This section is empty.

Variables

View Source
var AuthConfigFullMethods = map[string]AuthConfig{
	"/province.province/Get":    AuthConfig{NeedAuth: true, Roles: []string{"admin", "employee"}},
	"/province.province/GetAll": AuthConfig{NeedAuth: false, Roles: []string{"*"}},
}
View Source
var File_province_proto protoreflect.FileDescriptor
View Source
var FullMethods = fullMethods{
	Province_Get:    "/province.province/Get",
	Province_GetAll: "/province.province/GetAll",
}
View Source
var NeedApiKeyFullMethods = []string{}
View Source
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 AuthConfig struct {
	NeedAuth bool
	Roles    []string
}

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) Descriptor() ([]byte, []int)

Deprecated: Use GetReq.ProtoReflect.Descriptor instead.

func (*GetReq) GetId

func (x *GetReq) GetId() int32

func (*GetReq) ProtoMessage

func (*GetReq) ProtoMessage()

func (*GetReq) ProtoReflect

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

func (*GetReq) Reset

func (x *GetReq) Reset()

func (*GetReq) String

func (x *GetReq) String() string

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) Descriptor() ([]byte, []int)

Deprecated: Use Province.ProtoReflect.Descriptor instead.

func (*Province) GetId

func (x *Province) GetId() int32

func (*Province) GetName

func (x *Province) GetName() string

func (*Province) ProtoMessage

func (*Province) ProtoMessage()

func (*Province) ProtoReflect

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

func (*Province) Reset

func (x *Province) Reset()

func (*Province) String

func (x *Province) String() string

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) Descriptor() ([]byte, []int)

Deprecated: Use Provinces.ProtoReflect.Descriptor instead.

func (*Provinces) GetProvinces

func (x *Provinces) GetProvinces() []*Province

func (*Provinces) ProtoMessage

func (*Provinces) ProtoMessage()

func (*Provinces) ProtoReflect

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

func (*Provinces) Reset

func (x *Provinces) Reset()

func (*Provinces) String

func (x *Provinces) String() string

type UnimplementedProvinceServer

type UnimplementedProvinceServer struct {
}

UnimplementedProvinceServer must be embedded to have forward compatible implementations.

func (UnimplementedProvinceServer) Get

func (UnimplementedProvinceServer) GetAll

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.

Jump to

Keyboard shortcuts

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