example

package
v0.0.0-...-dcc7ea8 Latest Latest
Warning

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

Go to latest
Published: Dec 2, 2024 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Overview

Package example is a generated GoMock package.

Index

Constants

View Source
const (
	// GraphService_CreateTodo_FullMethodName is the full name of the method [graphImpl.CreateTodo].
	GraphService_CreateTodo_FullMethodName = "github.com/go-kod/kod-mono/internal/app/example/GraphService.CreateTodo"
	// GraphService_Todos_FullMethodName is the full name of the method [graphImpl.Todos].
	GraphService_Todos_FullMethodName = "github.com/go-kod/kod-mono/internal/app/example/GraphService.Todos"
	// Service_UniqueID_FullMethodName is the full name of the method [component.UniqueID].
	Service_UniqueID_FullMethodName = "github.com/go-kod/kod-mono/internal/app/example/Service.UniqueID"
)

Full method names for components.

Variables

This section is empty.

Functions

This section is empty.

Types

type GraphService

type GraphService interface {
	// Todos is implemented by [graphImpl.Todos]
	Todos(ctx context.Context) ([]*model.Todo, error)
	// CreateTodo is implemented by [graphImpl.CreateTodo]
	CreateTodo(ctx context.Context, input model.NewTodo) (*model.Todo, error)
}

GraphService is implemented by [graphImpl], which can be mocked with NewMockGraphService.

type MockGraphService

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

MockGraphService is a mock of GraphService interface.

func NewMockGraphService

func NewMockGraphService(ctrl *gomock.Controller) *MockGraphService

NewMockGraphService creates a new mock instance.

func (*MockGraphService) CreateTodo

func (m *MockGraphService) CreateTodo(ctx context.Context, input model.NewTodo) (*model.Todo, error)

CreateTodo mocks base method.

func (*MockGraphService) EXPECT

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

func (*MockGraphService) Todos

func (m *MockGraphService) Todos(ctx context.Context) ([]*model.Todo, error)

Todos mocks base method.

type MockGraphServiceCreateTodoCall

type MockGraphServiceCreateTodoCall struct {
	*gomock.Call
}

MockGraphServiceCreateTodoCall wrap *gomock.Call

func (*MockGraphServiceCreateTodoCall) Do

Do rewrite *gomock.Call.Do

func (*MockGraphServiceCreateTodoCall) DoAndReturn

DoAndReturn rewrite *gomock.Call.DoAndReturn

func (*MockGraphServiceCreateTodoCall) Return

Return rewrite *gomock.Call.Return

type MockGraphServiceMockRecorder

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

MockGraphServiceMockRecorder is the mock recorder for MockGraphService.

func (*MockGraphServiceMockRecorder) CreateTodo

CreateTodo indicates an expected call of CreateTodo.

func (*MockGraphServiceMockRecorder) Todos

Todos indicates an expected call of Todos.

type MockGraphServiceTodosCall

type MockGraphServiceTodosCall struct {
	*gomock.Call
}

MockGraphServiceTodosCall wrap *gomock.Call

func (*MockGraphServiceTodosCall) Do

Do rewrite *gomock.Call.Do

func (*MockGraphServiceTodosCall) DoAndReturn

DoAndReturn rewrite *gomock.Call.DoAndReturn

func (*MockGraphServiceTodosCall) Return

Return rewrite *gomock.Call.Return

type MockService

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

MockService is a mock of Service interface.

func NewMockService

func NewMockService(ctrl *gomock.Controller) *MockService

NewMockService creates a new mock instance.

func (*MockService) EXPECT

func (m *MockService) EXPECT() *MockServiceMockRecorder

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

func (*MockService) UniqueID

func (m *MockService) UniqueID(ctx context.Context, req *TestReq) (*TestRes, error)

UniqueID mocks base method.

type MockServiceMockRecorder

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

MockServiceMockRecorder is the mock recorder for MockService.

func (*MockServiceMockRecorder) UniqueID

func (mr *MockServiceMockRecorder) UniqueID(ctx, req any) *MockServiceUniqueIDCall

UniqueID indicates an expected call of UniqueID.

type MockServiceUniqueIDCall

type MockServiceUniqueIDCall struct {
	*gomock.Call
}

MockServiceUniqueIDCall wrap *gomock.Call

func (*MockServiceUniqueIDCall) Do

Do rewrite *gomock.Call.Do

func (*MockServiceUniqueIDCall) DoAndReturn

DoAndReturn rewrite *gomock.Call.DoAndReturn

func (*MockServiceUniqueIDCall) Return

Return rewrite *gomock.Call.Return

type Service

type Service interface {
	// UniqueID is implemented by [component.UniqueID]
	UniqueID(ctx context.Context, req *TestReq) (*TestRes, error)
}

Service is implemented by [component], which can be mocked with NewMockService.

type TestReq

type TestReq struct {
	Name string `form:"name"`
}

TestReq ...

type TestRes

type TestRes struct {
	// 唯一标识
	Uuid string
}

TestRes ...

Jump to

Keyboard shortcuts

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