test

package
v0.5.0 Latest Latest
Warning

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

Go to latest
Published: Dec 23, 2021 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Service

type Service interface {
	// CreateTodo adds a new todo to the todo list.
	CreateTodo(ctx context.Context, text string) (id string, err error)

	// ListTodos returns the list of todos.
	ListTodos(ctx context.Context) ([]Todo, error)

	// MarkAsDone marks a todo as done.
	MarkAsDone(ctx context.Context, id string) error

	// TouchTodo records work on a todo.
	TouchTodo(ctx context.Context, id oldtodo.ID)

	// ImportOldTodo imports a todo from the old format.
	ImportOldTodo(ctx context.Context, oldTodo oldtodo.OldTodo) (id string, err error)
}

+testify:mock

type Service2

type Service2 interface {
	// CreateTodo adds a new todo to the todo list.
	CreateTodo(ctx context.Context, text string) (id string, err error)

	// ListTodos returns the list of todos.
	ListTodos(ctx context.Context) ([]Todo, error)

	// MarkAsDone marks a todo as done.
	MarkAsDone(ctx context.Context, id string) error

	// TouchTodo records work on a todo.
	TouchTodo(ctx context.Context, id string)

	// ImportOldTodo imports a todo from the old format.
	ImportOldTodo(ctx context.Context, oldTodo oldtodo.OldTodo) (id string, err error)
}

+testify:mock:testOnly=true

type Service3

type Service3 interface {
	// nolint: lll
	Refresh(ctx context.Context, refreshToken string, deviceID string, userName string, jwtToken *jwt.Token) (string, string, error)
}

+testify:mock from: https://github.com/sagikazarmark/mga/issues/34

type Service4UnnamedParametersAndResults added in v0.2.1

type Service4UnnamedParametersAndResults interface {
	NamedParametersAndResults(isEnabled bool, count int, name string) (values []string, owner string, err error)

	UnnamedParameter(bool) (values []string, owner string, err error)

	UnnamedParameters(bool, int, string) (values []string, owner string, err error)

	UnnamedParametersAndResults(bool, int, string) ([]string, string, error)

	UnnamedResult(isEnabled bool, count int, name string) error

	UnnamedResults(isEnabled bool, count int, name string) ([]string, string, error)
}

+testify:mock from https://github.com/sagikazarmark/mga/pull/42 #1.

type Service5VariadicParameters added in v0.2.1

type Service5VariadicParameters interface {
	Regular(id string, count int, arguments []interface{}) (err error)

	Variadic(id string, count int, arguments ...interface{}) (err error)
}

+testify:mock from https://github.com/sagikazarmark/mga/pull/42 #2.

type Service6FunctionParameters added in v0.2.1

type Service6FunctionParameters interface {
	FunctionParameter(id string, predicate func(id oldtodo.ID, todo oldtodo.OldTodo) bool, count int) (err error)

	FunctionParameters(
		id string,
		predicate func(id string, importedTodo oldtodo.OldTodo) bool,
		operation func(count int, importedID oldtodo.ID),
		count int,
	) (err error)
}

+testify:mock from https://github.com/sagikazarmark/mga/pull/42 #3.

type Service7 added in v0.4.0

type Service7 interface {
	// CreateTodo adds a new todo to the todo list.
	CreateTodo(ctx context.Context, text string) (id string, err error)

	// ListTodos returns the list of todos.
	ListTodos(ctx context.Context) ([]Todo, error)

	// MarkAsDone marks a todo as done.
	MarkAsDone(ctx context.Context, id string) error

	// TouchTodo records work on a todo.
	TouchTodo(ctx context.Context, id string)

	// ImportOldTodo imports a todo from the old format.
	ImportOldTodo(ctx context.Context, oldTodo oldtodo.OldTodo) (id string, err error)
}

+testify:mock:external=true

type Service8 added in v0.4.0

type Service8 interface {
	// CreateTodo adds a new todo to the todo list.
	CreateTodo(ctx context.Context, text string) (id string, err error)

	// ListTodos returns the list of todos.
	ListTodos(ctx context.Context) ([]Todo, error)

	// MarkAsDone marks a todo as done.
	MarkAsDone(ctx context.Context, id string) error

	// TouchTodo records work on a todo.
	TouchTodo(ctx context.Context, id string)

	// ImportOldTodo imports a todo from the old format.
	ImportOldTodo(ctx context.Context, oldTodo oldtodo.OldTodo) (id string, err error)
}

+testify:mock:external=true,testOnly=true

type Todo

type Todo struct {
	ID   string
	Text string
	Done bool
}

nolint: godox Todo is a note describing a task to be done.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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