mocks

package
v0.0.0-...-d915e1c Latest Latest
Warning

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

Go to latest
Published: Dec 14, 2024 License: MIT Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type DatabaseMock

type DatabaseMock struct {
	GetPostHandler    func(int) (common.Post, error)
	GetPostsHandler   func(int, int) ([]common.Post, error)
	AddPostHandler    func(string, string, string) (int, error)
	DeletePostHandler func(int) (int, error)
	AddPageHandler    func(string, string, string) (int, error)
	GetPageHandler    func(string) (common.Page, error)
}

func (DatabaseMock) AddPage

func (db DatabaseMock) AddPage(title string, content string, link string) (int, error)

func (DatabaseMock) AddPost

func (db DatabaseMock) AddPost(title string, excerpt string, content string) (int, error)

func (DatabaseMock) ChangePost

func (db DatabaseMock) ChangePost(id int, title string, excerpt string, content string) error

func (DatabaseMock) DeletePost

func (db DatabaseMock) DeletePost(id int) (int, error)

func (DatabaseMock) GetPage

func (db DatabaseMock) GetPage(link string) (common.Page, error)

func (DatabaseMock) GetPost

func (db DatabaseMock) GetPost(post_id int) (common.Post, error)

func (DatabaseMock) GetPosts

func (db DatabaseMock) GetPosts(limit int, offset int) ([]common.Post, error)

Jump to

Keyboard shortcuts

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