board

package
v0.0.0-...-a8b6b34 Latest Latest
Warning

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

Go to latest
Published: Apr 24, 2024 License: Apache-2.0 Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CheckBoardExist

func CheckBoardExist(boardName string) (bool, string)

Types

type Board

type Board struct {
	Name           string
	Articles       article.Articles
	OnlineArticles article.Articles
	NewArticles    article.Articles
	// contains filtered or unexported fields
}

func NewBoard

func NewBoard(drive Driver, cache Cacher) *Board

func (Board) All

func (bd Board) All() (bds []*Board)

func (Board) Create

func (bd Board) Create() error

func (Board) Delete

func (bd Board) Delete() error

func (Board) Exist

func (bd Board) Exist() bool

func (Board) FetchArticles

func (bd Board) FetchArticles() (articles article.Articles)

func (Board) GetArticles

func (bd Board) GetArticles() (articles article.Articles)

func (Board) List

func (bd Board) List() []string

func (Board) Save

func (bd Board) Save() error

func (Board) SuggestBoardName

func (bd Board) SuggestBoardName() string

func (*Board) WithArticles

func (bd *Board) WithArticles()

func (*Board) WithNewArticles

func (bd *Board) WithNewArticles()

type BoardNotExistError

type BoardNotExistError struct {
	Suggestion string
}

func (BoardNotExistError) Error

func (e BoardNotExistError) Error() string

type Cacher

type Cacher interface {
	List() []string
	Create(boardName string) error
	Exist(boardName string) bool
	Remove(boardName string) error
}

type Driver

type Driver interface {
	GetArticles(boardName string) article.Articles
	Save(boardName string, articles article.Articles) error
	Delete(boardName string) error
}

type DynamoDB

type DynamoDB struct {
}

column: Board, Articles

func (DynamoDB) Delete

func (DynamoDB) Delete(boardName string) error

func (DynamoDB) GetArticles

func (DynamoDB) GetArticles(boardName string) (articles article.Articles)

func (DynamoDB) Save

func (DynamoDB) Save(boardName string, articles article.Articles) error

type File

type File struct {
}

func (File) Create

func (File) Create(boardName string) error

func (File) Delete

func (File) Delete(boardName string) error

func (File) Exist

func (File) Exist(boardName string) bool

func (File) GetArticles

func (File) GetArticles(boardName string) article.Articles

func (File) List

func (File) List() []string

func (File) Save

func (File) Save(boardName string, articles article.Articles) error

type Redis

type Redis struct {
}

func (Redis) Create

func (Redis) Create(boardName string) error

func (Redis) Delete

func (Redis) Delete(boardName string) error

func (Redis) Exist

func (Redis) Exist(boardName string) bool

func (Redis) GetArticles

func (Redis) GetArticles(boardName string) (articles article.Articles)

func (Redis) List

func (Redis) List() []string

func (Redis) Remove

func (Redis) Remove(boardName string) error

func (Redis) Save

func (Redis) Save(boardName string, articles article.Articles) error

Jump to

Keyboard shortcuts

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