Documentation ¶
Index ¶
- Variables
- func RegisterUsersServer(s grpc.ServiceRegistrar, srv UsersServer)
- type ServiceForm
- func (*ServiceForm) Descriptor() ([]byte, []int)deprecated
- func (x *ServiceForm) GetSecret() string
- func (x *ServiceForm) GetSession() *UserSession
- func (*ServiceForm) ProtoMessage()
- func (x *ServiceForm) ProtoReflect() protoreflect.Message
- func (x *ServiceForm) Reset()
- func (x *ServiceForm) String() string
- type UnimplementedUsersServer
- type UnsafeUsersServer
- type UserForm
- func (*UserForm) Descriptor() ([]byte, []int)deprecated
- func (x *UserForm) GetEmail() string
- func (x *UserForm) GetPassword() string
- func (x *UserForm) GetPasswordAgain() string
- func (x *UserForm) GetRefreshToken() string
- func (*UserForm) ProtoMessage()
- func (x *UserForm) ProtoReflect() protoreflect.Message
- func (x *UserForm) Reset()
- func (x *UserForm) String() string
- type UserInfo
- type UserSession
- func (*UserSession) Descriptor() ([]byte, []int)deprecated
- func (x *UserSession) GetExpires() int64
- func (x *UserSession) GetRefreshToken() string
- func (x *UserSession) GetToken() string
- func (*UserSession) ProtoMessage()
- func (x *UserSession) ProtoReflect() protoreflect.Message
- func (x *UserSession) Reset()
- func (x *UserSession) String() string
- type UsersClient
- type UsersServer
Constants ¶
This section is empty.
Variables ¶
var File_users_users_proto protoreflect.FileDescriptor
Functions ¶
func RegisterUsersServer ¶
func RegisterUsersServer(s grpc.ServiceRegistrar, srv UsersServer)
Types ¶
type ServiceForm ¶
type ServiceForm struct { Secret string `protobuf:"bytes,1,opt,name=secret,proto3" json:"secret,omitempty"` Session *UserSession `protobuf:"bytes,2,opt,name=session,proto3" json:"session,omitempty"` // contains filtered or unexported fields }
The service form message containing the secret key as well as the user session provided to the external service.
func (*ServiceForm) Descriptor
deprecated
func (*ServiceForm) Descriptor() ([]byte, []int)
Deprecated: Use ServiceForm.ProtoReflect.Descriptor instead.
func (*ServiceForm) GetSecret ¶
func (x *ServiceForm) GetSecret() string
func (*ServiceForm) GetSession ¶
func (x *ServiceForm) GetSession() *UserSession
func (*ServiceForm) ProtoMessage ¶
func (*ServiceForm) ProtoMessage()
func (*ServiceForm) ProtoReflect ¶
func (x *ServiceForm) ProtoReflect() protoreflect.Message
func (*ServiceForm) Reset ¶
func (x *ServiceForm) Reset()
func (*ServiceForm) String ¶
func (x *ServiceForm) String() string
type UnimplementedUsersServer ¶
type UnimplementedUsersServer struct { }
UnimplementedUsersServer must be embedded to have forward compatible implementations.
func (UnimplementedUsersServer) Authenticate ¶
func (UnimplementedUsersServer) Authenticate(context.Context, *UserForm) (*UserSession, error)
func (UnimplementedUsersServer) Authorize ¶
func (UnimplementedUsersServer) Authorize(context.Context, *ServiceForm) (*UserInfo, error)
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 UserForm ¶
type UserForm struct { Email string `protobuf:"bytes,1,opt,name=email,proto3" json:"email,omitempty"` Password string `protobuf:"bytes,2,opt,name=password,proto3" json:"password,omitempty"` PasswordAgain *string `protobuf:"bytes,3,opt,name=passwordAgain,proto3,oneof" json:"passwordAgain,omitempty"` RefreshToken *string `protobuf:"bytes,4,opt,name=refreshToken,proto3,oneof" json:"refreshToken,omitempty"` // contains filtered or unexported fields }
The user form message containing the users email and password(s). (Optional) contains the repeated password value for regisration. (Optional) contains the refresh token to re-authenticate.
func (*UserForm) Descriptor
deprecated
func (*UserForm) GetPassword ¶
func (*UserForm) GetPasswordAgain ¶
func (*UserForm) GetRefreshToken ¶
func (*UserForm) ProtoMessage ¶
func (*UserForm) ProtoMessage()
func (*UserForm) ProtoReflect ¶
func (x *UserForm) ProtoReflect() protoreflect.Message
type UserInfo ¶
type UserInfo struct { Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` // contains filtered or unexported fields }
The user info message containing details about the user.
func (*UserInfo) Descriptor
deprecated
func (*UserInfo) ProtoMessage ¶
func (*UserInfo) ProtoMessage()
func (*UserInfo) ProtoReflect ¶
func (x *UserInfo) ProtoReflect() protoreflect.Message
type UserSession ¶
type UserSession struct { Token string `protobuf:"bytes,1,opt,name=token,proto3" json:"token,omitempty"` Expires *int64 `protobuf:"varint,2,opt,name=expires,proto3,oneof" json:"expires,omitempty"` RefreshToken *string `protobuf:"bytes,3,opt,name=refreshToken,proto3,oneof" json:"refreshToken,omitempty"` // contains filtered or unexported fields }
The user session message containing details about the current users session. (Optional) contains the expiration time (Optioanl) cotains the refresh token
func (*UserSession) Descriptor
deprecated
func (*UserSession) Descriptor() ([]byte, []int)
Deprecated: Use UserSession.ProtoReflect.Descriptor instead.
func (*UserSession) GetExpires ¶
func (x *UserSession) GetExpires() int64
func (*UserSession) GetRefreshToken ¶
func (x *UserSession) GetRefreshToken() string
func (*UserSession) GetToken ¶
func (x *UserSession) GetToken() string
func (*UserSession) ProtoMessage ¶
func (*UserSession) ProtoMessage()
func (*UserSession) ProtoReflect ¶
func (x *UserSession) ProtoReflect() protoreflect.Message
func (*UserSession) Reset ¶
func (x *UserSession) Reset()
func (*UserSession) String ¶
func (x *UserSession) String() string
type UsersClient ¶
type UsersClient interface { // Allow a user to register with the service. Register(ctx context.Context, in *UserForm, opts ...grpc.CallOption) (*UserInfo, error) // Allow a user to authenticate with the service. Authenticate(ctx context.Context, in *UserForm, opts ...grpc.CallOption) (*UserSession, error) // Allows an external service to authorize a request. Authorize(ctx context.Context, in *ServiceForm, opts ...grpc.CallOption) (*UserInfo, 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
type UsersServer ¶
type UsersServer interface { // Allow a user to register with the service. Register(context.Context, *UserForm) (*UserInfo, error) // Allow a user to authenticate with the service. Authenticate(context.Context, *UserForm) (*UserSession, error) // Allows an external service to authorize a request. Authorize(context.Context, *ServiceForm) (*UserInfo, error) // contains filtered or unexported methods }
UsersServer is the server API for Users service. All implementations must embed UnimplementedUsersServer for forward compatibility