entity

package
v0.0.6 Latest Latest
Warning

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

Go to latest
Published: May 11, 2020 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Cookie struct {
	ID       xid.ID
	Title    string
	Category *string
	Fortune  string
}

func NewCookie

func NewCookie(title string, category *string,
	fortune string) *Cookie

func NewCookieFromModel

func NewCookieFromModel(model *repository.Model) *Cookie

func (*Cookie) ToModel

func (e *Cookie) ToModel() *repository.Model

type CookieMethods

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

func (*CookieMethods) Create

func (m *CookieMethods) Create(ctx context.Context, title string,
	category *string) (*Cookie, error)

func (*CookieMethods) Delete

func (m *CookieMethods) Delete(ctx context.Context, cookieID xid.ID) error

func (*CookieMethods) ListAll

func (m *CookieMethods) ListAll(ctx context.Context) ([]*Cookie, error)

func (*CookieMethods) Modify

func (m *CookieMethods) Modify(ctx context.Context, cookieID xid.ID,
	title string, category *string) (*Cookie, error)

type Methods

type Methods interface {
	Create(ctx context.Context, title string, category *string) (*Cookie, error)
	ListAll(ctx context.Context) ([]*Cookie, error)
	Delete(ctx context.Context, cookieID xid.ID) error
	Modify(ctx context.Context, cookieID xid.ID, title string, category *string) (*Cookie, error)
}

func NewCookieMethods

func NewCookieMethods(repository repository.Repository) Methods

type MockMethods

type MockMethods struct {
	mock.Mock
}

func NewMockMethods

func NewMockMethods() *MockMethods

func (*MockMethods) Create

func (m *MockMethods) Create(ctx context.Context, title string,
	category *string) (*Cookie, error)

func (*MockMethods) Delete

func (m *MockMethods) Delete(ctx context.Context, cookieID xid.ID) error

func (*MockMethods) ListAll

func (m *MockMethods) ListAll(ctx context.Context) ([]*Cookie, error)

func (*MockMethods) Modify

func (m *MockMethods) Modify(ctx context.Context, cookieID xid.ID,
	title string, category *string) (*Cookie, error)

Jump to

Keyboard shortcuts

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