service

package
v0.0.0-...-0e17a7f Latest Latest
Warning

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

Go to latest
Published: Apr 8, 2023 License: MIT Imports: 27 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func EnvConf

func EnvConf(env BoardEnvironment) func(*BoardService) *BoardService

func RepoConf

func RepoConf(repo repository.BoardRepository) func(*BoardService) *BoardService

Types

type AdminFunction

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

func (*AdminFunction) CreateBoard

func (admin *AdminFunction) CreateBoard(boardName string) error

空の板を作成する。 すでに存在する場合エラーを返す。

func (*AdminFunction) GetWriteCount

func (admin *AdminFunction) GetWriteCount() (_ int, err error)

func (*AdminFunction) Login

func (admin *AdminFunction) Login(passphrase, signature string) (string, error)

func (*AdminFunction) Logout

func (admin *AdminFunction) Logout() error

func (*AdminFunction) ResetWriteCount

func (admin *AdminFunction) ResetWriteCount() error

func (*AdminFunction) VerifySession

func (admin *AdminFunction) VerifySession(sessionId string) error

type AlterMemcache

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

func NewAlterMemcache

func NewAlterMemcache(ctx context.Context, client *datastore.Client) *AlterMemcache

func (*AlterMemcache) Delete

func (mem *AlterMemcache) Delete(key string) error

func (*AlterMemcache) Get

func (mem *AlterMemcache) Get(key string) (*memcache.Item, error)

func (*AlterMemcache) Set

func (mem *AlterMemcache) Set(item *memcache.Item) error

type BoardEnvironment

type BoardEnvironment interface {
	StartedAt() time.Time
	SaltComputeId() string
}

type BoardMemcache

type BoardMemcache interface {
	Set(item *memcache.Item) error
	Get(key string) (*memcache.Item, error)
	Delete(key string) error
}

type BoardService

type BoardService struct {
	Admin *AdminFunction
	// contains filtered or unexported fields
}

Dependency injection for Board

func DefaultBoardService

func DefaultBoardService() (*BoardService, error)

func NewBoardService

func NewBoardService(config ...func(*BoardService) *BoardService) *BoardService

func (*BoardService) ComputeId

func (sv *BoardService) ComputeId(ipAddr, boardName string) string

func (*BoardService) CreateThread

func (sv *BoardService) CreateThread(stng bbscfg.Setting, boardName string,
	name, mail, id, message, title string) (threadKey string, err error)

Creates a Thread

func (*BoardService) MakeDat

func (sv *BoardService) MakeDat(boardName, threadKey string) (_ []byte, _ time.Time, err error)

データストアからエンティティを取得しdatを返す

func (*BoardService) MakeDatJson

func (sv *BoardService) MakeDatJson(boardName, threadKey string,
	ifModifiedSince string, min, max int) (_ []byte, err error)

データストアからエンティティを取得しdatをjsonとして返す

func (*BoardService) MakeSubjectJson

func (sv *BoardService) MakeSubjectJson(boardName string, limit int) (_ []byte, err error)

データストアからエンティティを取得しjsonとして返す

func (*BoardService) MakeSubjectTxt

func (sv *BoardService) MakeSubjectTxt(boardName string) (_ []byte, err error)

データストアからエンティティを取得しsubject.txtとして返す

func (*BoardService) StartedAt

func (sv *BoardService) StartedAt() time.Time

func (*BoardService) WriteDat

func (sv *BoardService) WriteDat(stng bbscfg.Setting, boardName, threadKey,
	name, mail, id, message string) (resnum int, err error)

type SysEnv

type SysEnv struct {
	StartedTime   time.Time
	ComputeIdSalt string
}

func (*SysEnv) SaltComputeId

func (env *SysEnv) SaltComputeId() string

func (*SysEnv) StartedAt

func (env *SysEnv) StartedAt() time.Time

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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