city

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: city.proto

Package city 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{
	"/city.city/Get":          AuthConfig{NeedAuth: false, Roles: []string{"*"}},
	"/city.city/Search":       AuthConfig{NeedAuth: false, Roles: []string{"*"}},
	"/city.city/FileDownload": AuthConfig{NeedAuth: false, Roles: []string{"*"}},
}
View Source
var FullMethods = fullMethods{
	City_Get:          "/city.city/Get",
	City_Search:       "/city.city/Search",
	City_FileDownload: "/city.city/FileDownload",
}
View Source
var NeedApiKeyFullMethods = []string{}
View Source
var NeedAuthFullMethods = []string{}

Functions

func RegisterCityGrstServer

func RegisterCityGrstServer(grpcRestServer *grst.Server, hndl CityServer)

func RegisterCityHandler

func RegisterCityHandler(ctx context.Context, mux *runtime.ServeMux, conn *grpc.ClientConn) error

RegisterCityHandler registers the http handlers for service City to "mux". The handlers forward requests to the grpc endpoint over "conn".

func RegisterCityHandlerClient

func RegisterCityHandlerClient(ctx context.Context, mux *runtime.ServeMux, client CityClient) error

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

func RegisterCityHandlerServer(ctx context.Context, mux *runtime.ServeMux, server CityServer) error

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 AuthConfig struct {
	NeedAuth bool
	Roles    []string
}

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

Deprecated: Use City.ProtoReflect.Descriptor instead.

func (*City) GetId

func (x *City) GetId() int32

func (*City) GetName

func (x *City) GetName() string

func (*City) GetProvinceId

func (x *City) GetProvinceId() int32

func (*City) ProtoMessage

func (*City) ProtoMessage()

func (*City) ProtoReflect

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

func (*City) Reset

func (x *City) Reset()

func (*City) String

func (x *City) String() string

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

Deprecated: Use SearchReq.ProtoReflect.Descriptor instead.

func (*SearchReq) GetKeyword

func (x *SearchReq) GetKeyword() string

func (*SearchReq) ProtoMessage

func (*SearchReq) ProtoMessage()

func (*SearchReq) ProtoReflect

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

func (*SearchReq) Reset

func (x *SearchReq) Reset()

func (*SearchReq) String

func (x *SearchReq) String() string

type UnimplementedCityServer

type UnimplementedCityServer struct {
}

UnimplementedCityServer must be embedded to have forward compatible implementations.

func (UnimplementedCityServer) FileDownload

func (UnimplementedCityServer) Get

func (UnimplementedCityServer) Search

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.

Jump to

Keyboard shortcuts

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