Documentation ¶
Overview ¶
Code generated by protoc-gen-cdd. DO NOT EDIT. source: city.proto
Package city is a reverse proxy.
It translates gRPC into RESTful JSON APIs.
Index ¶
- Variables
- func RegisterCityGrstServer(grpcRestServer *grst.Server, hndl CityServer)
- func RegisterCityHandler(ctx context.Context, mux *runtime.ServeMux, conn *grpc.ClientConn) error
- func RegisterCityHandlerClient(ctx context.Context, mux *runtime.ServeMux, client CityClient) error
- func RegisterCityHandlerFromEndpoint(ctx context.Context, mux *runtime.ServeMux, endpoint string, ...) (err error)
- func RegisterCityHandlerServer(ctx context.Context, mux *runtime.ServeMux, server CityServer) error
- func RegisterCityServer(s *grpc.Server, srv CityServer)
- func ValidateRequest(req interface{}) error
- type AuthConfig
- type City
- type CityClient
- type CityProfile
- func (*CityProfile) Descriptor() ([]byte, []int)deprecated
- func (x *CityProfile) GetId() int32
- func (x *CityProfile) GetName() string
- func (x *CityProfile) GetProvinceId() int32
- func (x *CityProfile) GetProvinceName() string
- func (*CityProfile) ProtoMessage()
- func (x *CityProfile) ProtoReflect() protoreflect.Message
- func (x *CityProfile) Reset()
- func (x *CityProfile) String() string
- type CityProfiles
- type CityServer
- type FileDownloadResp
- func (*FileDownloadResp) Descriptor() ([]byte, []int)deprecated
- func (x *FileDownloadResp) GetFileContent() string
- func (x *FileDownloadResp) GetFilename() string
- func (*FileDownloadResp) ProtoMessage()
- func (x *FileDownloadResp) ProtoReflect() protoreflect.Message
- func (x *FileDownloadResp) Reset()
- func (x *FileDownloadResp) String() string
- type GetReq
- type SearchReq
- type UnimplementedCityServer
- type UnsafeCityServer
Constants ¶
This section is empty.
Variables ¶
var AuthConfigFullMethods = map[string]AuthConfig{ "/city.city/Get": AuthConfig{NeedAuth: false, Roles: []string{"*"}}, "/city.city/Search": AuthConfig{NeedAuth: false, Roles: []string{"*"}}, "/city.city/FileDownload": AuthConfig{NeedAuth: false, Roles: []string{"*"}}, }
var File_city_proto protoreflect.FileDescriptor
var FullMethods = fullMethods{
City_Get: "/city.city/Get",
City_Search: "/city.city/Search",
City_FileDownload: "/city.city/FileDownload",
}
var NeedApiKeyFullMethods = []string{}
var NeedAuthFullMethods = []string{}
Functions ¶
func RegisterCityGrstServer ¶
func RegisterCityGrstServer(grpcRestServer *grst.Server, hndl CityServer)
func RegisterCityHandler ¶
RegisterCityHandler registers the http handlers for service City to "mux". The handlers forward requests to the grpc endpoint over "conn".
func RegisterCityHandlerClient ¶
RegisterCityHandlerClient registers the http handlers for service City to "mux". The handlers forward requests to the grpc endpoint over the given implementation of "CityClient". Note: the gRPC framework executes interceptors within the gRPC handler. If the passed in "CityClient" doesn't go through the normal gRPC flow (creating a gRPC client etc.) then it will be up to the passed in "CityClient" to call the correct interceptors.
func RegisterCityHandlerFromEndpoint ¶
func RegisterCityHandlerFromEndpoint(ctx context.Context, mux *runtime.ServeMux, endpoint string, opts []grpc.DialOption) (err error)
RegisterCityHandlerFromEndpoint is same as RegisterCityHandler but automatically dials to "endpoint" and closes the connection when "ctx" gets done.
func RegisterCityHandlerServer ¶
RegisterCityHandlerServer registers the http handlers for service City to "mux". UnaryRPC :call CityServer 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 RegisterCityHandlerFromEndpoint instead.
func RegisterCityServer ¶
func RegisterCityServer(s *grpc.Server, srv CityServer)
func ValidateRequest ¶
func ValidateRequest(req interface{}) error
Types ¶
type AuthConfig ¶
type City ¶
type City struct { Id int32 `protobuf:"varint,1,opt,name=Id,json=id,proto3" json:"id,omitempty"` ProvinceId int32 `protobuf:"varint,2,opt,name=ProvinceId,json=province_id,proto3" json:"province_id,omitempty"` Name string `protobuf:"bytes,3,opt,name=Name,json=name,proto3" json:"name,omitempty"` // contains filtered or unexported fields }
func (*City) Descriptor
deprecated
func (*City) GetProvinceId ¶
func (*City) ProtoMessage ¶
func (*City) ProtoMessage()
func (*City) ProtoReflect ¶
func (x *City) ProtoReflect() protoreflect.Message
type CityClient ¶
type CityClient interface { Get(ctx context.Context, in *GetReq, opts ...grpc.CallOption) (*City, error) Search(ctx context.Context, in *SearchReq, opts ...grpc.CallOption) (*CityProfiles, error) FileDownload(ctx context.Context, in *empty.Empty, opts ...grpc.CallOption) (*FileDownloadResp, error) }
CityClient is the client API for City 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 NewCityClient ¶
func NewCityClient(cc grpc.ClientConnInterface) CityClient
func NewCityGrstClient ¶
func NewCityGrstClient(serverHost string, creds *credentials.TransportCredentials, dialOpts ...grpc.DialOption) (CityClient, error)
type CityProfile ¶
type CityProfile 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"` ProvinceName string `protobuf:"bytes,3,opt,name=ProvinceName,json=province_name,proto3" json:"province_name,omitempty"` ProvinceId int32 `protobuf:"varint,4,opt,name=ProvinceId,json=province_id,proto3" json:"province_id,omitempty"` // contains filtered or unexported fields }
func (*CityProfile) Descriptor
deprecated
func (*CityProfile) Descriptor() ([]byte, []int)
Deprecated: Use CityProfile.ProtoReflect.Descriptor instead.
func (*CityProfile) GetId ¶
func (x *CityProfile) GetId() int32
func (*CityProfile) GetName ¶
func (x *CityProfile) GetName() string
func (*CityProfile) GetProvinceId ¶
func (x *CityProfile) GetProvinceId() int32
func (*CityProfile) GetProvinceName ¶
func (x *CityProfile) GetProvinceName() string
func (*CityProfile) ProtoMessage ¶
func (*CityProfile) ProtoMessage()
func (*CityProfile) ProtoReflect ¶
func (x *CityProfile) ProtoReflect() protoreflect.Message
func (*CityProfile) Reset ¶
func (x *CityProfile) Reset()
func (*CityProfile) String ¶
func (x *CityProfile) String() string
type CityProfiles ¶
type CityProfiles struct { Cities []*CityProfile `protobuf:"bytes,1,rep,name=Cities,json=cities,proto3" json:"cities,omitempty"` // contains filtered or unexported fields }
func (*CityProfiles) Descriptor
deprecated
func (*CityProfiles) Descriptor() ([]byte, []int)
Deprecated: Use CityProfiles.ProtoReflect.Descriptor instead.
func (*CityProfiles) GetCities ¶
func (x *CityProfiles) GetCities() []*CityProfile
func (*CityProfiles) ProtoMessage ¶
func (*CityProfiles) ProtoMessage()
func (*CityProfiles) ProtoReflect ¶
func (x *CityProfiles) ProtoReflect() protoreflect.Message
func (*CityProfiles) Reset ¶
func (x *CityProfiles) Reset()
func (*CityProfiles) String ¶
func (x *CityProfiles) String() string
type CityServer ¶
type CityServer interface { Get(context.Context, *GetReq) (*City, error) Search(context.Context, *SearchReq) (*CityProfiles, error) FileDownload(context.Context, *empty.Empty) (*FileDownloadResp, error) // contains filtered or unexported methods }
CityServer is the server API for City service. All implementations must embed UnimplementedCityServer for forward compatibility
type FileDownloadResp ¶
type FileDownloadResp struct { Filename string `protobuf:"bytes,1,opt,name=Filename,json=filename,proto3" json:"filename,omitempty"` FileContent string `protobuf:"bytes,2,opt,name=FileContent,json=filecontent,proto3" json:"filecontent,omitempty"` // need to be base64 encode // contains filtered or unexported fields }
func (*FileDownloadResp) Descriptor
deprecated
func (*FileDownloadResp) Descriptor() ([]byte, []int)
Deprecated: Use FileDownloadResp.ProtoReflect.Descriptor instead.
func (*FileDownloadResp) GetFileContent ¶
func (x *FileDownloadResp) GetFileContent() string
func (*FileDownloadResp) GetFilename ¶
func (x *FileDownloadResp) GetFilename() string
func (*FileDownloadResp) ProtoMessage ¶
func (*FileDownloadResp) ProtoMessage()
func (*FileDownloadResp) ProtoReflect ¶
func (x *FileDownloadResp) ProtoReflect() protoreflect.Message
func (*FileDownloadResp) Reset ¶
func (x *FileDownloadResp) Reset()
func (*FileDownloadResp) String ¶
func (x *FileDownloadResp) String() 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) ProtoMessage ¶
func (*GetReq) ProtoMessage()
func (*GetReq) ProtoReflect ¶
func (x *GetReq) ProtoReflect() protoreflect.Message
type SearchReq ¶
type SearchReq struct { Keyword string `protobuf:"bytes,1,opt,name=Keyword,json=keyword,proto3" json:"keyword,omitempty" validate:"required"` // contains filtered or unexported fields }
func (*SearchReq) Descriptor
deprecated
func (*SearchReq) GetKeyword ¶
func (*SearchReq) ProtoMessage ¶
func (*SearchReq) ProtoMessage()
func (*SearchReq) ProtoReflect ¶
func (x *SearchReq) ProtoReflect() protoreflect.Message
type UnimplementedCityServer ¶
type UnimplementedCityServer struct { }
UnimplementedCityServer must be embedded to have forward compatible implementations.
func (UnimplementedCityServer) FileDownload ¶
func (UnimplementedCityServer) FileDownload(context.Context, *empty.Empty) (*FileDownloadResp, error)
func (UnimplementedCityServer) Search ¶
func (UnimplementedCityServer) Search(context.Context, *SearchReq) (*CityProfiles, error)
type UnsafeCityServer ¶
type UnsafeCityServer interface {
// contains filtered or unexported methods
}
UnsafeCityServer may be embedded to opt out of forward compatibility for this service. Use of this interface is not recommended, as added methods to CityServer will result in compilation errors.