user

package
v0.0.0-...-74253e5 Latest Latest
Warning

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

Go to latest
Published: Aug 26, 2024 License: Apache-2.0 Imports: 17 Imported by: 0

Documentation

Overview

Package user is a generated GoMock package.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AuthRequest

type AuthRequest struct {
	Token string `validate:"required"`
}

type AuthResponse

type AuthResponse struct {
	Valid bool
	Uid   uint64
}

type Component

type Component interface {
	// Register register a user
	Register(ctx context.Context, req *RegisterRequest) (*RegisterResponse, error)
	// DeRegister deregister a user
	DeRegister(ctx context.Context, req *DeRegisterRequest) (*DeRegisterResponse, error)
	// Login login a user with jwt
	Login(ctx context.Context, req *LoginRequest) (*LoginResponse, error)
	// Auth auth a user with jwt
	Auth(ctx context.Context, req *AuthRequest) (*AuthResponse, error)
}

impl is a component that implements Component.

type DeRegisterRequest

type DeRegisterRequest struct {
	Uid uint64 `validate:"required"`
}

type DeRegisterResponse

type DeRegisterResponse struct{}

type LoginRequest

type LoginRequest struct {
	UserName string `validate:"required"`
	Password string `validate:"required"`
}

type LoginResponse

type LoginResponse struct {
	Token string
}

type MockComponent

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

MockComponent is a mock of Component interface.

func NewMockComponent

func NewMockComponent(ctrl *gomock.Controller) *MockComponent

NewMockComponent creates a new mock instance.

func (*MockComponent) Auth

func (m *MockComponent) Auth(ctx context.Context, req *AuthRequest) (*AuthResponse, error)

Auth mocks base method.

func (*MockComponent) DeRegister

DeRegister mocks base method.

func (*MockComponent) EXPECT

EXPECT returns an object that allows the caller to indicate expected use.

func (*MockComponent) Login

func (m *MockComponent) Login(ctx context.Context, req *LoginRequest) (*LoginResponse, error)

Login mocks base method.

func (*MockComponent) Register

Register mocks base method.

type MockComponentMockRecorder

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

MockComponentMockRecorder is the mock recorder for MockComponent.

func (*MockComponentMockRecorder) Auth

func (mr *MockComponentMockRecorder) Auth(ctx, req any) *gomock.Call

Auth indicates an expected call of Auth.

func (*MockComponentMockRecorder) DeRegister

func (mr *MockComponentMockRecorder) DeRegister(ctx, req any) *gomock.Call

DeRegister indicates an expected call of DeRegister.

func (*MockComponentMockRecorder) Login

func (mr *MockComponentMockRecorder) Login(ctx, req any) *gomock.Call

Login indicates an expected call of Login.

func (*MockComponentMockRecorder) Register

func (mr *MockComponentMockRecorder) Register(ctx, req any) *gomock.Call

Register indicates an expected call of Register.

type RegisterRequest

type RegisterRequest struct {
	UserName string `redis:"username" validate:"required"`
	Password string `redis:"password" validate:"required"`
}

type RegisterResponse

type RegisterResponse struct {
	Uid uint64
}

Jump to

Keyboard shortcuts

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