account

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Jun 13, 2024 License: MIT Imports: 18 Imported by: 0

Documentation

Overview

Package account is a reverse proxy.

It translates gRPC into RESTful JSON APIs.

Index

Constants

View Source
const (
	AccountService_LoginUser_FullMethodName    = "/public.account.v1.AccountService/LoginUser"
	AccountService_LogoutUser_FullMethodName   = "/public.account.v1.AccountService/LogoutUser"
	AccountService_RefreshToken_FullMethodName = "/public.account.v1.AccountService/RefreshToken"
	AccountService_CreateUser_FullMethodName   = "/public.account.v1.AccountService/CreateUser"
	AccountService_ListUsers_FullMethodName    = "/public.account.v1.AccountService/ListUsers"
)

Variables

View Source
var AccountService_ServiceDesc = grpc.ServiceDesc{
	ServiceName: "public.account.v1.AccountService",
	HandlerType: (*AccountServiceServer)(nil),
	Methods: []grpc.MethodDesc{
		{
			MethodName: "LoginUser",
			Handler:    _AccountService_LoginUser_Handler,
		},
		{
			MethodName: "LogoutUser",
			Handler:    _AccountService_LogoutUser_Handler,
		},
		{
			MethodName: "RefreshToken",
			Handler:    _AccountService_RefreshToken_Handler,
		},
		{
			MethodName: "CreateUser",
			Handler:    _AccountService_CreateUser_Handler,
		},
		{
			MethodName: "ListUsers",
			Handler:    _AccountService_ListUsers_Handler,
		},
	},
	Streams:  []grpc.StreamDesc{},
	Metadata: "public/account/v1/account_service.proto",
}

AccountService_ServiceDesc is the grpc.ServiceDesc for AccountService service. It's only intended for direct use with grpc.RegisterService, and not to be introspected or modified (even as a copy)

View Source
var File_public_account_v1_account_service_proto protoreflect.FileDescriptor
View Source
var File_public_account_v1_organization_proto protoreflect.FileDescriptor
View Source
var File_public_account_v1_user_proto protoreflect.FileDescriptor

Functions

func RegisterAccountServiceHandler

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

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

func RegisterAccountServiceHandlerClient

func RegisterAccountServiceHandlerClient(ctx context.Context, mux *runtime.ServeMux, client AccountServiceClient) error

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

func RegisterAccountServiceHandlerFromEndpoint

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

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

func RegisterAccountServiceHandlerServer

func RegisterAccountServiceHandlerServer(ctx context.Context, mux *runtime.ServeMux, server AccountServiceServer) error

RegisterAccountServiceHandlerServer registers the http handlers for service AccountService to "mux". UnaryRPC :call AccountServiceServer 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 RegisterAccountServiceHandlerFromEndpoint instead.

func RegisterAccountServiceServer

func RegisterAccountServiceServer(s grpc.ServiceRegistrar, srv AccountServiceServer)

Types

type AccountServiceClient

type AccountServiceClient interface {
	LoginUser(ctx context.Context, in *LoginUserRequest, opts ...grpc.CallOption) (*LoginUserResponse, error)
	LogoutUser(ctx context.Context, in *LogoutUserRequest, opts ...grpc.CallOption) (*LogoutUserResponse, error)
	RefreshToken(ctx context.Context, in *RefreshTokenRequest, opts ...grpc.CallOption) (*RefreshTokenResponse, error)
	CreateUser(ctx context.Context, in *CreateUserRequest, opts ...grpc.CallOption) (*CreateUserResponse, error)
	ListUsers(ctx context.Context, in *ListUsersRequest, opts ...grpc.CallOption) (*ListUsersResponse, error)
}

AccountServiceClient is the client API for AccountService 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 AccountServiceServer

type AccountServiceServer interface {
	LoginUser(context.Context, *LoginUserRequest) (*LoginUserResponse, error)
	LogoutUser(context.Context, *LogoutUserRequest) (*LogoutUserResponse, error)
	RefreshToken(context.Context, *RefreshTokenRequest) (*RefreshTokenResponse, error)
	CreateUser(context.Context, *CreateUserRequest) (*CreateUserResponse, error)
	ListUsers(context.Context, *ListUsersRequest) (*ListUsersResponse, error)
	// contains filtered or unexported methods
}

AccountServiceServer is the server API for AccountService service. All implementations must embed UnimplementedAccountServiceServer for forward compatibility

type CreateUserRequest

type CreateUserRequest struct {

	// Resource name of the parent resource where to create the user.
	// For example: "organizations/123"
	Parent string `protobuf:"bytes,1,opt,name=parent,proto3" json:"parent,omitempty"`
	// The user resource to be created. Client must not set the `User.name` field.
	User *User `protobuf:"bytes,2,opt,name=user,proto3" json:"user,omitempty"`
	// contains filtered or unexported fields
}

func (*CreateUserRequest) Descriptor deprecated

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

Deprecated: Use CreateUserRequest.ProtoReflect.Descriptor instead.

func (*CreateUserRequest) GetParent

func (x *CreateUserRequest) GetParent() string

func (*CreateUserRequest) GetUser

func (x *CreateUserRequest) GetUser() *User

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 ListUsersRequest

type ListUsersRequest struct {

	// Resource name of the parent resource where to list the users.
	// For example: "organizations/123"
	Parent string `protobuf:"bytes,1,opt,name=parent,proto3" json:"parent,omitempty"`
	// contains filtered or unexported fields
}

func (*ListUsersRequest) Descriptor deprecated

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

Deprecated: Use ListUsersRequest.ProtoReflect.Descriptor instead.

func (*ListUsersRequest) GetParent

func (x *ListUsersRequest) GetParent() string

func (*ListUsersRequest) ProtoMessage

func (*ListUsersRequest) ProtoMessage()

func (*ListUsersRequest) ProtoReflect

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

func (*ListUsersRequest) Reset

func (x *ListUsersRequest) Reset()

func (*ListUsersRequest) String

func (x *ListUsersRequest) String() string

type ListUsersResponse

type ListUsersResponse struct {

	// The users in the parent resource.
	Users []*User `protobuf:"bytes,1,rep,name=users,proto3" json:"users,omitempty"`
	// contains filtered or unexported fields
}

func (*ListUsersResponse) Descriptor deprecated

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

Deprecated: Use ListUsersResponse.ProtoReflect.Descriptor instead.

func (*ListUsersResponse) GetUsers

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

func (*ListUsersResponse) ProtoMessage

func (*ListUsersResponse) ProtoMessage()

func (*ListUsersResponse) ProtoReflect

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

func (*ListUsersResponse) Reset

func (x *ListUsersResponse) Reset()

func (*ListUsersResponse) String

func (x *ListUsersResponse) String() string

type LoginUserRequest

type LoginUserRequest struct {

	// Types that are assignable to Login:
	//
	//	*LoginUserRequest_Email
	//	*LoginUserRequest_Username
	Login    isLoginUserRequest_Login `protobuf_oneof:"login"`
	Password string                   `protobuf:"bytes,3,opt,name=password,proto3" json:"password,omitempty"`
	// contains filtered or unexported fields
}

func (*LoginUserRequest) Descriptor deprecated

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

Deprecated: Use LoginUserRequest.ProtoReflect.Descriptor instead.

func (*LoginUserRequest) GetEmail

func (x *LoginUserRequest) GetEmail() string

func (*LoginUserRequest) GetLogin

func (m *LoginUserRequest) GetLogin() isLoginUserRequest_Login

func (*LoginUserRequest) GetPassword

func (x *LoginUserRequest) GetPassword() string

func (*LoginUserRequest) GetUsername

func (x *LoginUserRequest) GetUsername() string

func (*LoginUserRequest) ProtoMessage

func (*LoginUserRequest) ProtoMessage()

func (*LoginUserRequest) ProtoReflect

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

func (*LoginUserRequest) Reset

func (x *LoginUserRequest) Reset()

func (*LoginUserRequest) String

func (x *LoginUserRequest) String() string

type LoginUserRequest_Email

type LoginUserRequest_Email struct {
	Email string `protobuf:"bytes,1,opt,name=email,proto3,oneof"`
}

type LoginUserRequest_Username

type LoginUserRequest_Username struct {
	Username string `protobuf:"bytes,2,opt,name=username,proto3,oneof"`
}

type LoginUserResponse

type LoginUserResponse struct {
	User         *User  `protobuf:"bytes,1,opt,name=user,proto3" json:"user,omitempty"`
	Token        string `protobuf:"bytes,2,opt,name=token,proto3" json:"token,omitempty"`
	RefreshToken string `protobuf:"bytes,3,opt,name=refresh_token,json=refreshToken,proto3" json:"refresh_token,omitempty"`
	// contains filtered or unexported fields
}

func (*LoginUserResponse) Descriptor deprecated

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

Deprecated: Use LoginUserResponse.ProtoReflect.Descriptor instead.

func (*LoginUserResponse) GetRefreshToken

func (x *LoginUserResponse) GetRefreshToken() string

func (*LoginUserResponse) GetToken

func (x *LoginUserResponse) GetToken() string

func (*LoginUserResponse) GetUser

func (x *LoginUserResponse) GetUser() *User

func (*LoginUserResponse) ProtoMessage

func (*LoginUserResponse) ProtoMessage()

func (*LoginUserResponse) ProtoReflect

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

func (*LoginUserResponse) Reset

func (x *LoginUserResponse) Reset()

func (*LoginUserResponse) String

func (x *LoginUserResponse) String() string

type LogoutUserRequest

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

func (*LogoutUserRequest) Descriptor deprecated

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

Deprecated: Use LogoutUserRequest.ProtoReflect.Descriptor instead.

func (*LogoutUserRequest) ProtoMessage

func (*LogoutUserRequest) ProtoMessage()

func (*LogoutUserRequest) ProtoReflect

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

func (*LogoutUserRequest) Reset

func (x *LogoutUserRequest) Reset()

func (*LogoutUserRequest) String

func (x *LogoutUserRequest) String() string

type LogoutUserResponse

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

func (*LogoutUserResponse) Descriptor deprecated

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

Deprecated: Use LogoutUserResponse.ProtoReflect.Descriptor instead.

func (*LogoutUserResponse) ProtoMessage

func (*LogoutUserResponse) ProtoMessage()

func (*LogoutUserResponse) ProtoReflect

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

func (*LogoutUserResponse) Reset

func (x *LogoutUserResponse) Reset()

func (*LogoutUserResponse) String

func (x *LogoutUserResponse) String() string

type Organization

type Organization struct {

	// The name of the organization. Example: "organizations/dd69abd0-4f8b-4e53-9acd-4c38f87e7047"
	Name       string                 `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"`
	LegalName  string                 `protobuf:"bytes,2,opt,name=legal_name,json=legalName,proto3" json:"legal_name,omitempty"`
	UpdateTime *timestamppb.Timestamp `protobuf:"bytes,10,opt,name=update_time,json=updateTime,proto3" json:"update_time,omitempty"`
	CreateTime *timestamppb.Timestamp `protobuf:"bytes,11,opt,name=create_time,json=createTime,proto3" json:"create_time,omitempty"`
	// contains filtered or unexported fields
}

func (*Organization) Descriptor deprecated

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

Deprecated: Use Organization.ProtoReflect.Descriptor instead.

func (*Organization) GetCreateTime

func (x *Organization) GetCreateTime() *timestamppb.Timestamp

func (*Organization) GetLegalName

func (x *Organization) GetLegalName() string

func (*Organization) GetName

func (x *Organization) GetName() string

func (*Organization) GetUpdateTime

func (x *Organization) GetUpdateTime() *timestamppb.Timestamp

func (*Organization) ProtoMessage

func (*Organization) ProtoMessage()

func (*Organization) ProtoReflect

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

func (*Organization) Reset

func (x *Organization) Reset()

func (*Organization) String

func (x *Organization) String() string

type RefreshTokenRequest

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

func (*RefreshTokenRequest) Descriptor deprecated

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

Deprecated: Use RefreshTokenRequest.ProtoReflect.Descriptor instead.

func (*RefreshTokenRequest) ProtoMessage

func (*RefreshTokenRequest) ProtoMessage()

func (*RefreshTokenRequest) ProtoReflect

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

func (*RefreshTokenRequest) Reset

func (x *RefreshTokenRequest) Reset()

func (*RefreshTokenRequest) String

func (x *RefreshTokenRequest) String() string

type RefreshTokenResponse

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

func (*RefreshTokenResponse) Descriptor deprecated

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

Deprecated: Use RefreshTokenResponse.ProtoReflect.Descriptor instead.

func (*RefreshTokenResponse) ProtoMessage

func (*RefreshTokenResponse) ProtoMessage()

func (*RefreshTokenResponse) ProtoReflect

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

func (*RefreshTokenResponse) Reset

func (x *RefreshTokenResponse) Reset()

func (*RefreshTokenResponse) String

func (x *RefreshTokenResponse) String() string

type UnimplementedAccountServiceServer

type UnimplementedAccountServiceServer struct {
}

UnimplementedAccountServiceServer must be embedded to have forward compatible implementations.

func (UnimplementedAccountServiceServer) CreateUser

func (UnimplementedAccountServiceServer) ListUsers

func (UnimplementedAccountServiceServer) LoginUser

func (UnimplementedAccountServiceServer) LogoutUser

func (UnimplementedAccountServiceServer) RefreshToken

type UnsafeAccountServiceServer

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

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

type User

type User struct {

	// The user's unique identifier. example: users/dd69abd0-4f8b-4e53-9acd-4c38f87e7047
	Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"`
	// The user's display name.
	DisplayName string `protobuf:"bytes,2,opt,name=display_name,json=displayName,proto3" json:"display_name,omitempty"`
	// The user's email.
	Email string `protobuf:"bytes,3,opt,name=email,proto3" json:"email,omitempty"`
	// The user's password.
	Password   string                 `protobuf:"bytes,4,opt,name=password,proto3" json:"password,omitempty"`
	UpdateTime *timestamppb.Timestamp `protobuf:"bytes,10,opt,name=update_time,json=updateTime,proto3" json:"update_time,omitempty"`
	CreateTime *timestamppb.Timestamp `protobuf:"bytes,11,opt,name=create_time,json=createTime,proto3" json:"create_time,omitempty"`
	// contains filtered or unexported fields
}

func (*User) Descriptor deprecated

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

Deprecated: Use User.ProtoReflect.Descriptor instead.

func (*User) GetCreateTime

func (x *User) GetCreateTime() *timestamppb.Timestamp

func (*User) GetDisplayName

func (x *User) GetDisplayName() string

func (*User) GetEmail

func (x *User) GetEmail() string

func (*User) GetName

func (x *User) GetName() string

func (*User) GetPassword

func (x *User) GetPassword() string

func (*User) GetUpdateTime

func (x *User) GetUpdateTime() *timestamppb.Timestamp

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

Jump to

Keyboard shortcuts

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