userspb

package
v0.0.0-...-9fe20ad Latest Latest
Warning

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

Go to latest
Published: Apr 21, 2022 License: MIT Imports: 17 Imported by: 0

Documentation

Overview

Package userspb is a reverse proxy.

It translates gRPC into RESTful JSON APIs.

Index

Constants

This section is empty.

Variables

View Source
var (
	Gender_name = map[int32]string{
		0: "NOT_SPECIFIED",
		1: "MALE",
		2: "FEMALE",
		3: "OTHER",
	}
	Gender_value = map[string]int32{
		"NOT_SPECIFIED": 0,
		"MALE":          1,
		"FEMALE":        2,
		"OTHER":         3,
	}
)

Enum value maps for Gender.

View Source
var File_users_api_proto protoreflect.FileDescriptor

Functions

func RegisterUsersServiceHandler

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

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

func RegisterUsersServiceHandlerClient

func RegisterUsersServiceHandlerClient(ctx context.Context, mux *runtime.ServeMux, client UsersServiceClient) error

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

func RegisterUsersServiceHandlerFromEndpoint

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

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

func RegisterUsersServiceHandlerServer

func RegisterUsersServiceHandlerServer(ctx context.Context, mux *runtime.ServeMux, server UsersServiceServer) error

RegisterUsersServiceHandlerServer registers the http handlers for service UsersService to "mux". UnaryRPC :call UsersServiceServer 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 RegisterUsersServiceHandlerFromEndpoint instead.

func RegisterUsersServiceServer

func RegisterUsersServiceServer(s *grpc.Server, srv UsersServiceServer)

Types

type AuthenticateRequest

type AuthenticateRequest struct {
	Username string `protobuf:"bytes,1,opt,name=username,proto3" json:"username,omitempty"`
	Password string `protobuf:"bytes,2,opt,name=password,proto3" json:"password,omitempty"`
	// contains filtered or unexported fields
}

func (*AuthenticateRequest) Descriptor deprecated

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

Deprecated: Use AuthenticateRequest.ProtoReflect.Descriptor instead.

func (*AuthenticateRequest) GetPassword

func (x *AuthenticateRequest) GetPassword() string

func (*AuthenticateRequest) GetUsername

func (x *AuthenticateRequest) GetUsername() string

func (*AuthenticateRequest) ProtoMessage

func (*AuthenticateRequest) ProtoMessage()

func (*AuthenticateRequest) ProtoReflect

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

func (*AuthenticateRequest) Reset

func (x *AuthenticateRequest) Reset()

func (*AuthenticateRequest) String

func (x *AuthenticateRequest) String() string

type AuthenticateResponse

type AuthenticateResponse struct {
	Auth bool  `protobuf:"varint,1,opt,name=Auth,proto3" json:"Auth,omitempty"`
	User *User `protobuf:"bytes,2,opt,name=user,proto3" json:"user,omitempty"`
	// contains filtered or unexported fields
}

func (*AuthenticateResponse) Descriptor deprecated

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

Deprecated: Use AuthenticateResponse.ProtoReflect.Descriptor instead.

func (*AuthenticateResponse) GetAuth

func (x *AuthenticateResponse) GetAuth() bool

func (*AuthenticateResponse) GetUser

func (x *AuthenticateResponse) GetUser() *User

func (*AuthenticateResponse) ProtoMessage

func (*AuthenticateResponse) ProtoMessage()

func (*AuthenticateResponse) ProtoReflect

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

func (*AuthenticateResponse) Reset

func (x *AuthenticateResponse) Reset()

func (*AuthenticateResponse) String

func (x *AuthenticateResponse) String() string

type CreateUserRequest

type CreateUserRequest struct {
	Username string `protobuf:"bytes,1,opt,name=username,proto3" json:"username,omitempty"`
	Password string `protobuf:"bytes,2,opt,name=password,proto3" json:"password,omitempty"`
	// contains filtered or unexported fields
}

func (*CreateUserRequest) Descriptor deprecated

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

Deprecated: Use CreateUserRequest.ProtoReflect.Descriptor instead.

func (*CreateUserRequest) GetPassword

func (x *CreateUserRequest) GetPassword() string

func (*CreateUserRequest) GetUsername

func (x *CreateUserRequest) GetUsername() string

func (*CreateUserRequest) ProtoMessage

func (*CreateUserRequest) ProtoMessage()

func (*CreateUserRequest) ProtoReflect

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

func (*CreateUserRequest) Reset

func (x *CreateUserRequest) Reset()

func (*CreateUserRequest) String

func (x *CreateUserRequest) String() string

type CreateUserResponse

type CreateUserResponse struct {
	User *User `protobuf:"bytes,1,opt,name=user,proto3" json:"user,omitempty"`
	// contains filtered or unexported fields
}

func (*CreateUserResponse) Descriptor deprecated

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

Deprecated: Use CreateUserResponse.ProtoReflect.Descriptor instead.

func (*CreateUserResponse) GetUser

func (x *CreateUserResponse) GetUser() *User

func (*CreateUserResponse) ProtoMessage

func (*CreateUserResponse) ProtoMessage()

func (*CreateUserResponse) ProtoReflect

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

func (*CreateUserResponse) Reset

func (x *CreateUserResponse) Reset()

func (*CreateUserResponse) String

func (x *CreateUserResponse) String() string

type EmptyData

type EmptyData struct {
	// contains filtered or unexported fields
}

func (*EmptyData) Descriptor deprecated

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

Deprecated: Use EmptyData.ProtoReflect.Descriptor instead.

func (*EmptyData) ProtoMessage

func (*EmptyData) ProtoMessage()

func (*EmptyData) ProtoReflect

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

func (*EmptyData) Reset

func (x *EmptyData) Reset()

func (*EmptyData) String

func (x *EmptyData) String() string

type FollowUserRequest

type FollowUserRequest struct {
	Username string `protobuf:"bytes,1,opt,name=username,proto3" json:"username,omitempty"`
	// contains filtered or unexported fields
}

func (*FollowUserRequest) Descriptor deprecated

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

Deprecated: Use FollowUserRequest.ProtoReflect.Descriptor instead.

func (*FollowUserRequest) GetUsername

func (x *FollowUserRequest) GetUsername() string

func (*FollowUserRequest) ProtoMessage

func (*FollowUserRequest) ProtoMessage()

func (*FollowUserRequest) ProtoReflect

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

func (*FollowUserRequest) Reset

func (x *FollowUserRequest) Reset()

func (*FollowUserRequest) String

func (x *FollowUserRequest) String() string

type Gender

type Gender int32
const (
	Gender_NOT_SPECIFIED Gender = 0
	Gender_MALE          Gender = 1
	Gender_FEMALE        Gender = 2
	Gender_OTHER         Gender = 3
)

func (Gender) Descriptor

func (Gender) Descriptor() protoreflect.EnumDescriptor

func (Gender) Enum

func (x Gender) Enum() *Gender

func (Gender) EnumDescriptor deprecated

func (Gender) EnumDescriptor() ([]byte, []int)

Deprecated: Use Gender.Descriptor instead.

func (Gender) Number

func (x Gender) Number() protoreflect.EnumNumber

func (Gender) String

func (x Gender) String() string

func (Gender) Type

func (Gender) Type() protoreflect.EnumType

type GetProfileRequest

type GetProfileRequest struct {
	Username string `protobuf:"bytes,1,opt,name=username,proto3" json:"username,omitempty"`
	// contains filtered or unexported fields
}

func (*GetProfileRequest) Descriptor deprecated

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

Deprecated: Use GetProfileRequest.ProtoReflect.Descriptor instead.

func (*GetProfileRequest) GetUsername

func (x *GetProfileRequest) GetUsername() string

func (*GetProfileRequest) ProtoMessage

func (*GetProfileRequest) ProtoMessage()

func (*GetProfileRequest) ProtoReflect

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

func (*GetProfileRequest) Reset

func (x *GetProfileRequest) Reset()

func (*GetProfileRequest) String

func (x *GetProfileRequest) String() string

type GetProfileResponse

type GetProfileResponse struct {
	Profile   *Profile `protobuf:"bytes,1,opt,name=Profile,proto3" json:"Profile,omitempty"`
	User      *User    `protobuf:"bytes,2,opt,name=user,proto3" json:"user,omitempty"`
	Following bool     `protobuf:"varint,3,opt,name=following,proto3" json:"following,omitempty"`
	// contains filtered or unexported fields
}

func (*GetProfileResponse) Descriptor deprecated

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

Deprecated: Use GetProfileResponse.ProtoReflect.Descriptor instead.

func (*GetProfileResponse) GetFollowing

func (x *GetProfileResponse) GetFollowing() bool

func (*GetProfileResponse) GetProfile

func (x *GetProfileResponse) GetProfile() *Profile

func (*GetProfileResponse) GetUser

func (x *GetProfileResponse) GetUser() *User

func (*GetProfileResponse) ProtoMessage

func (*GetProfileResponse) ProtoMessage()

func (*GetProfileResponse) ProtoReflect

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

func (*GetProfileResponse) Reset

func (x *GetProfileResponse) Reset()

func (*GetProfileResponse) String

func (x *GetProfileResponse) String() string

type GetUserByIDRequest

type GetUserByIDRequest struct {
	Id int64 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"`
	// contains filtered or unexported fields
}

func (*GetUserByIDRequest) Descriptor deprecated

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

Deprecated: Use GetUserByIDRequest.ProtoReflect.Descriptor instead.

func (*GetUserByIDRequest) GetId

func (x *GetUserByIDRequest) GetId() int64

func (*GetUserByIDRequest) ProtoMessage

func (*GetUserByIDRequest) ProtoMessage()

func (*GetUserByIDRequest) ProtoReflect

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

func (*GetUserByIDRequest) Reset

func (x *GetUserByIDRequest) Reset()

func (*GetUserByIDRequest) String

func (x *GetUserByIDRequest) String() string

type GetUserFollowingRequest

type GetUserFollowingRequest struct {
	Userid int64 `protobuf:"varint,1,opt,name=userid,proto3" json:"userid,omitempty"`
	// contains filtered or unexported fields
}

func (*GetUserFollowingRequest) Descriptor deprecated

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

Deprecated: Use GetUserFollowingRequest.ProtoReflect.Descriptor instead.

func (*GetUserFollowingRequest) GetUserid

func (x *GetUserFollowingRequest) GetUserid() int64

func (*GetUserFollowingRequest) ProtoMessage

func (*GetUserFollowingRequest) ProtoMessage()

func (*GetUserFollowingRequest) ProtoReflect

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

func (*GetUserFollowingRequest) Reset

func (x *GetUserFollowingRequest) Reset()

func (*GetUserFollowingRequest) String

func (x *GetUserFollowingRequest) String() string

type GetUserFollowingResponse

type GetUserFollowingResponse struct {
	Users []int64 `protobuf:"varint,1,rep,packed,name=users,proto3" json:"users,omitempty"`
	// contains filtered or unexported fields
}

func (*GetUserFollowingResponse) Descriptor deprecated

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

Deprecated: Use GetUserFollowingResponse.ProtoReflect.Descriptor instead.

func (*GetUserFollowingResponse) GetUsers

func (x *GetUserFollowingResponse) GetUsers() []int64

func (*GetUserFollowingResponse) ProtoMessage

func (*GetUserFollowingResponse) ProtoMessage()

func (*GetUserFollowingResponse) ProtoReflect

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

func (*GetUserFollowingResponse) Reset

func (x *GetUserFollowingResponse) Reset()

func (*GetUserFollowingResponse) String

func (x *GetUserFollowingResponse) String() string

type GetUserRequest

type GetUserRequest struct {
	Username string `protobuf:"bytes,1,opt,name=username,proto3" json:"username,omitempty"`
	// contains filtered or unexported fields
}

func (*GetUserRequest) Descriptor deprecated

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

Deprecated: Use GetUserRequest.ProtoReflect.Descriptor instead.

func (*GetUserRequest) GetUsername

func (x *GetUserRequest) GetUsername() string

func (*GetUserRequest) ProtoMessage

func (*GetUserRequest) ProtoMessage()

func (*GetUserRequest) ProtoReflect

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

func (*GetUserRequest) Reset

func (x *GetUserRequest) Reset()

func (*GetUserRequest) String

func (x *GetUserRequest) String() string

type GetUserResponse

type GetUserResponse struct {
	User *User `protobuf:"bytes,1,opt,name=user,proto3" json:"user,omitempty"`
	// contains filtered or unexported fields
}

func (*GetUserResponse) Descriptor deprecated

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

Deprecated: Use GetUserResponse.ProtoReflect.Descriptor instead.

func (*GetUserResponse) GetUser

func (x *GetUserResponse) GetUser() *User

func (*GetUserResponse) ProtoMessage

func (*GetUserResponse) ProtoMessage()

func (*GetUserResponse) ProtoReflect

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

func (*GetUserResponse) Reset

func (x *GetUserResponse) Reset()

func (*GetUserResponse) String

func (x *GetUserResponse) String() string

type GetUsersResponse

type GetUsersResponse struct {
	Users []*User `protobuf:"bytes,1,rep,name=users,proto3" json:"users,omitempty"`
	// contains filtered or unexported fields
}

func (*GetUsersResponse) Descriptor deprecated

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

Deprecated: Use GetUsersResponse.ProtoReflect.Descriptor instead.

func (*GetUsersResponse) GetUsers

func (x *GetUsersResponse) GetUsers() []*User

func (*GetUsersResponse) ProtoMessage

func (*GetUsersResponse) ProtoMessage()

func (*GetUsersResponse) ProtoReflect

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

func (*GetUsersResponse) Reset

func (x *GetUsersResponse) Reset()

func (*GetUsersResponse) String

func (x *GetUsersResponse) String() string

type PingMessage

type PingMessage struct {
	Greeting string `protobuf:"bytes,1,opt,name=greeting,proto3" json:"greeting,omitempty"`
	// contains filtered or unexported fields
}

func (*PingMessage) Descriptor deprecated

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

Deprecated: Use PingMessage.ProtoReflect.Descriptor instead.

func (*PingMessage) GetGreeting

func (x *PingMessage) GetGreeting() string

func (*PingMessage) ProtoMessage

func (*PingMessage) ProtoMessage()

func (*PingMessage) ProtoReflect

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

func (*PingMessage) Reset

func (x *PingMessage) Reset()

func (*PingMessage) String

func (x *PingMessage) String() string

type Profile

type Profile struct {
	UserId      int64  `protobuf:"varint,1,opt,name=userId,proto3" json:"userId,omitempty"`
	DisplayName string `protobuf:"bytes,2,opt,name=displayName,proto3" json:"displayName,omitempty"`
	DateOfBirth string `protobuf:"bytes,3,opt,name=dateOfBirth,proto3" json:"dateOfBirth,omitempty"`
	Gender      Gender `protobuf:"varint,4,opt,name=gender,proto3,enum=userspb.Gender" json:"gender,omitempty"`
	Followers   int64  `protobuf:"varint,6,opt,name=followers,proto3" json:"followers,omitempty"`
	Following   int64  `protobuf:"varint,7,opt,name=following,proto3" json:"following,omitempty"`
	// contains filtered or unexported fields
}

func (*Profile) Descriptor deprecated

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

Deprecated: Use Profile.ProtoReflect.Descriptor instead.

func (*Profile) GetDateOfBirth

func (x *Profile) GetDateOfBirth() string

func (*Profile) GetDisplayName

func (x *Profile) GetDisplayName() string

func (*Profile) GetFollowers

func (x *Profile) GetFollowers() int64

func (*Profile) GetFollowing

func (x *Profile) GetFollowing() int64

func (*Profile) GetGender

func (x *Profile) GetGender() Gender

func (*Profile) GetUserId

func (x *Profile) GetUserId() int64

func (*Profile) ProtoMessage

func (*Profile) ProtoMessage()

func (*Profile) ProtoReflect

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

func (*Profile) Reset

func (x *Profile) Reset()

func (*Profile) String

func (x *Profile) String() string

type SetProfileRequest

type SetProfileRequest struct {
	Profile *Profile `protobuf:"bytes,1,opt,name=profile,proto3" json:"profile,omitempty"`
	// contains filtered or unexported fields
}

func (*SetProfileRequest) Descriptor deprecated

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

Deprecated: Use SetProfileRequest.ProtoReflect.Descriptor instead.

func (*SetProfileRequest) GetProfile

func (x *SetProfileRequest) GetProfile() *Profile

func (*SetProfileRequest) ProtoMessage

func (*SetProfileRequest) ProtoMessage()

func (*SetProfileRequest) ProtoReflect

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

func (*SetProfileRequest) Reset

func (x *SetProfileRequest) Reset()

func (*SetProfileRequest) String

func (x *SetProfileRequest) String() string

type UnimplementedUsersServiceServer

type UnimplementedUsersServiceServer struct {
}

UnimplementedUsersServiceServer must be embedded to have forward compatible implementations.

func (UnimplementedUsersServiceServer) Authenticate

func (UnimplementedUsersServiceServer) CreateUser

func (UnimplementedUsersServiceServer) FollowUser

func (UnimplementedUsersServiceServer) GetProfile

func (UnimplementedUsersServiceServer) GetUser

func (UnimplementedUsersServiceServer) GetUserByID

func (UnimplementedUsersServiceServer) GetUserFollowing

func (UnimplementedUsersServiceServer) GetUserProfile

func (UnimplementedUsersServiceServer) GetUsers

func (UnimplementedUsersServiceServer) SayHello

func (UnimplementedUsersServiceServer) SetProfile

func (UnimplementedUsersServiceServer) UnFollowUser

type UnsafeUsersServiceServer

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

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

type User

type User struct {
	Id       int64  `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"`
	Username string `protobuf:"bytes,2,opt,name=username,proto3" json:"username,omitempty"`
	Created  int64  `protobuf:"varint,3,opt,name=created,proto3" json:"created,omitempty"`
	// contains filtered or unexported fields
}

func (*User) Descriptor deprecated

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

Deprecated: Use User.ProtoReflect.Descriptor instead.

func (*User) GetCreated

func (x *User) GetCreated() int64

func (*User) GetId

func (x *User) GetId() int64

func (*User) GetUsername

func (x *User) GetUsername() string

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 UsersServiceClient

type UsersServiceClient interface {
	SayHello(ctx context.Context, in *PingMessage, opts ...grpc.CallOption) (*PingMessage, error)
	CreateUser(ctx context.Context, in *CreateUserRequest, opts ...grpc.CallOption) (*CreateUserResponse, error)
	GetUsers(ctx context.Context, in *EmptyData, opts ...grpc.CallOption) (*GetUsersResponse, error)
	GetProfile(ctx context.Context, in *EmptyData, opts ...grpc.CallOption) (*GetProfileResponse, error)
	GetUser(ctx context.Context, in *GetUserRequest, opts ...grpc.CallOption) (*GetUserResponse, error)
	Authenticate(ctx context.Context, in *AuthenticateRequest, opts ...grpc.CallOption) (*AuthenticateResponse, error)
	GetUserByID(ctx context.Context, in *GetUserByIDRequest, opts ...grpc.CallOption) (*GetUserResponse, error)
	SetProfile(ctx context.Context, in *SetProfileRequest, opts ...grpc.CallOption) (*GetProfileResponse, error)
	GetUserProfile(ctx context.Context, in *GetProfileRequest, opts ...grpc.CallOption) (*GetProfileResponse, error)
	FollowUser(ctx context.Context, in *FollowUserRequest, opts ...grpc.CallOption) (*EmptyData, error)
	UnFollowUser(ctx context.Context, in *FollowUserRequest, opts ...grpc.CallOption) (*EmptyData, error)
	GetUserFollowing(ctx context.Context, in *GetUserFollowingRequest, opts ...grpc.CallOption) (*GetUserFollowingResponse, error)
}

UsersServiceClient is the client API for UsersService 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.

type UsersServiceServer

UsersServiceServer is the server API for UsersService service. All implementations must embed UnimplementedUsersServiceServer for forward compatibility

Jump to

Keyboard shortcuts

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