users

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: 24 Imported by: 0

Documentation

Overview

Code generated by protoc-gen-cdd. DO NOT EDIT. source: users.proto

Package users 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{
	"/users.users/GetProfile": AuthConfig{NeedAuth: false, Roles: []string{"*"}},
}
View Source
var File_users_proto protoreflect.FileDescriptor
View Source
var FullMethods = fullMethods{
	Users_GetProfile: "/users.users/GetProfile",
}
View Source
var NeedApiKeyFullMethods = []string{}
View Source
var NeedAuthFullMethods = []string{}

Functions

func RegisterUsersGrstServer

func RegisterUsersGrstServer(grpcRestServer *grst.Server, hndl UsersServer)

func RegisterUsersHandler

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

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

func RegisterUsersHandlerClient

func RegisterUsersHandlerClient(ctx context.Context, mux *runtime.ServeMux, client UsersClient) error

RegisterUsersHandlerClient registers the http handlers for service Users to "mux". The handlers forward requests to the grpc endpoint over the given implementation of "UsersClient". Note: the gRPC framework executes interceptors within the gRPC handler. If the passed in "UsersClient" doesn't go through the normal gRPC flow (creating a gRPC client etc.) then it will be up to the passed in "UsersClient" to call the correct interceptors.

func RegisterUsersHandlerFromEndpoint

func RegisterUsersHandlerFromEndpoint(ctx context.Context, mux *runtime.ServeMux, endpoint string, opts []grpc.DialOption) (err error)

RegisterUsersHandlerFromEndpoint is same as RegisterUsersHandler but automatically dials to "endpoint" and closes the connection when "ctx" gets done.

func RegisterUsersHandlerServer

func RegisterUsersHandlerServer(ctx context.Context, mux *runtime.ServeMux, server UsersServer) error

RegisterUsersHandlerServer registers the http handlers for service Users to "mux". UnaryRPC :call UsersServer 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 RegisterUsersHandlerFromEndpoint instead.

func RegisterUsersServer

func RegisterUsersServer(s *grpc.Server, srv UsersServer)

func ValidateRequest

func ValidateRequest(req interface{}) error

Types

type AuthConfig

type AuthConfig struct {
	NeedAuth bool
	Roles    []string
}

type GetProfileReq

type GetProfileReq 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 (*GetProfileReq) Descriptor deprecated

func (*GetProfileReq) Descriptor() ([]byte, []int)

Deprecated: Use GetProfileReq.ProtoReflect.Descriptor instead.

func (*GetProfileReq) GetId

func (x *GetProfileReq) GetId() int32

func (*GetProfileReq) ProtoMessage

func (*GetProfileReq) ProtoMessage()

func (*GetProfileReq) ProtoReflect

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

func (*GetProfileReq) Reset

func (x *GetProfileReq) Reset()

func (*GetProfileReq) String

func (x *GetProfileReq) String() string

type UnimplementedUsersServer

type UnimplementedUsersServer struct {
}

UnimplementedUsersServer must be embedded to have forward compatible implementations.

func (UnimplementedUsersServer) GetProfile

type UnsafeUsersServer

type UnsafeUsersServer interface {
	// contains filtered or unexported methods
}

UnsafeUsersServer may be embedded to opt out of forward compatibility for this service. Use of this interface is not recommended, as added methods to UsersServer will result in compilation errors.

type User

type User 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"`
	ProvinceId int32  `protobuf:"varint,3,opt,name=ProvinceId,json=province_id,proto3" json:"province_id,omitempty"`
	// contains filtered or unexported fields
}

func (*User) Descriptor deprecated

func (*User) Descriptor() ([]byte, []int)

Deprecated: Use User.ProtoReflect.Descriptor instead.

func (*User) GetId

func (x *User) GetId() int32

func (*User) GetName

func (x *User) GetName() string

func (*User) GetProvinceId

func (x *User) GetProvinceId() int32

func (*User) ProtoMessage

func (*User) ProtoMessage()

func (*User) ProtoReflect

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

func (*User) Reset

func (x *User) Reset()

func (*User) String

func (x *User) String() string

type UserProfile

type UserProfile struct {
	Id           int32  `protobuf:"varint,1,opt,name=Id,proto3" json:"Id,omitempty"`
	Name         string `protobuf:"bytes,2,opt,name=Name,json=name,proto3" json:"name,omitempty"`
	ProvinceId   int32  `protobuf:"varint,3,opt,name=ProvinceId,json=province_id,proto3" json:"province_id,omitempty"`
	ProvinceName string `protobuf:"bytes,4,opt,name=ProvinceName,json=province_name,proto3" json:"province_name,omitempty"`
	// contains filtered or unexported fields
}

func (*UserProfile) Descriptor deprecated

func (*UserProfile) Descriptor() ([]byte, []int)

Deprecated: Use UserProfile.ProtoReflect.Descriptor instead.

func (*UserProfile) GetId

func (x *UserProfile) GetId() int32

func (*UserProfile) GetName

func (x *UserProfile) GetName() string

func (*UserProfile) GetProvinceId

func (x *UserProfile) GetProvinceId() int32

func (*UserProfile) GetProvinceName

func (x *UserProfile) GetProvinceName() string

func (*UserProfile) ProtoMessage

func (*UserProfile) ProtoMessage()

func (*UserProfile) ProtoReflect

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

func (*UserProfile) Reset

func (x *UserProfile) Reset()

func (*UserProfile) String

func (x *UserProfile) String() string

type UsersClient

type UsersClient interface {
	GetProfile(ctx context.Context, in *GetProfileReq, opts ...grpc.CallOption) (*UserProfile, error)
}

UsersClient is the client API for Users 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 NewUsersClient

func NewUsersClient(cc grpc.ClientConnInterface) UsersClient

func NewUsersGrstClient

func NewUsersGrstClient(serverHost string, creds *credentials.TransportCredentials, dialOpts ...grpc.DialOption) (UsersClient, error)

type UsersServer

type UsersServer interface {
	GetProfile(context.Context, *GetProfileReq) (*UserProfile, error)
	// contains filtered or unexported methods
}

UsersServer is the server API for Users service. All implementations must embed UnimplementedUsersServer for forward compatibility

Jump to

Keyboard shortcuts

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