repository

package
v0.0.0-...-bf7c91d Latest Latest
Warning

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

Go to latest
Published: Dec 8, 2020 License: MIT Imports: 4 Imported by: 0

Documentation

Overview

Package repository is a generated GoMock package.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Character

type Character struct {
	ID            int64
	Name          string
	Class         commands.Class
	DiscordUserID string
}

Character is a playable character model

type CharacterRepository

type CharacterRepository struct {
	Conn *sql.DB
}

CharacterRepository struct for db connection

func (*CharacterRepository) Close

func (repository *CharacterRepository) Close()

Close the DB connection

func (*CharacterRepository) Create

func (repository *CharacterRepository) Create(character *Character) error

Create saves a character in db

func (*CharacterRepository) GetCharacterByDiscordUserID

func (repository *CharacterRepository) GetCharacterByDiscordUserID(discordUserID string) (*Character, error)

GetCharacterByDiscordUserID get a character by its discord user id (unique)

type CharacterRepositoryInterface

type CharacterRepositoryInterface interface {
	Create(character *Character) error
	GetCharacterByDiscordUserID(discordUserID string) (*Character, error)
}

CharacterRepositoryInterface interface for functions for character repository

type MockCharacterRepositoryInterface

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

MockCharacterRepositoryInterface is a mock of CharacterRepositoryInterface interface

func NewMockCharacterRepositoryInterface

func NewMockCharacterRepositoryInterface(ctrl *gomock.Controller) *MockCharacterRepositoryInterface

NewMockCharacterRepositoryInterface creates a new mock instance

func (*MockCharacterRepositoryInterface) Create

func (m *MockCharacterRepositoryInterface) Create(character *Character) error

Create mocks base method

func (*MockCharacterRepositoryInterface) EXPECT

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

func (*MockCharacterRepositoryInterface) GetCharacterByDiscordUserID

func (m *MockCharacterRepositoryInterface) GetCharacterByDiscordUserID(discordUserID string) (*Character, error)

GetCharacterByDiscordUserID mocks base method

type MockCharacterRepositoryInterfaceMockRecorder

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

MockCharacterRepositoryInterfaceMockRecorder is the mock recorder for MockCharacterRepositoryInterface

func (*MockCharacterRepositoryInterfaceMockRecorder) Create

func (mr *MockCharacterRepositoryInterfaceMockRecorder) Create(character interface{}) *gomock.Call

Create indicates an expected call of Create

func (*MockCharacterRepositoryInterfaceMockRecorder) GetCharacterByDiscordUserID

func (mr *MockCharacterRepositoryInterfaceMockRecorder) GetCharacterByDiscordUserID(discordUserID interface{}) *gomock.Call

GetCharacterByDiscordUserID indicates an expected call of GetCharacterByDiscordUserID

Jump to

Keyboard shortcuts

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