users

package
v0.0.0-...-f8686ab Latest Latest
Warning

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

Go to latest
Published: Nov 24, 2020 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
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) Authorize

func (UnimplementedUsersServer) Register

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

Deprecated: Use UserForm.ProtoReflect.Descriptor instead.

func (*UserForm) GetEmail

func (x *UserForm) GetEmail() string

func (*UserForm) GetPassword

func (x *UserForm) GetPassword() string

func (*UserForm) GetPasswordAgain

func (x *UserForm) GetPasswordAgain() string

func (*UserForm) GetRefreshToken

func (x *UserForm) GetRefreshToken() string

func (*UserForm) ProtoMessage

func (*UserForm) ProtoMessage()

func (*UserForm) ProtoReflect

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

func (*UserForm) Reset

func (x *UserForm) Reset()

func (*UserForm) String

func (x *UserForm) String() string

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

Deprecated: Use UserInfo.ProtoReflect.Descriptor instead.

func (*UserInfo) GetId

func (x *UserInfo) GetId() string

func (*UserInfo) ProtoMessage

func (*UserInfo) ProtoMessage()

func (*UserInfo) ProtoReflect

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

func (*UserInfo) Reset

func (x *UserInfo) Reset()

func (*UserInfo) String

func (x *UserInfo) String() string

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

Jump to

Keyboard shortcuts

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