sitestore

package
v0.4.17 Latest Latest
Warning

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

Go to latest
Published: Dec 20, 2021 License: LGPL-3.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

View Source
const (
	InitNs      = "SiteInit"
	SiteNs      = "Site"
	InitTimeKey = "initTime"
	SiteCfgKey  = "siteCfg"
)

Variables

View Source
var (
	ErrNotFound = errors.New("site config not found")
)

Functions

func IsNotFound

func IsNotFound(err error) bool

Types

type BgConfig

type BgConfig struct {
	Url      string `json:"url"`
	Repeat   string `json:"repeat"`
	Position string `json:"position"`
	Align    string `json:"align"`
}

type ClientConfig

type ClientConfig struct {
	SiteName string    `json:"siteName"`
	SiteDesc string    `json:"siteDesc"`
	Bg       *BgConfig `json:"bg"`
}

type ISiteStore

type ISiteStore interface {
	SetClientCfg(cfg *ClientConfig) error
	GetCfg() (*SiteConfig, error)
}

type SiteConfig

type SiteConfig struct {
	ClientCfg *ClientConfig `json:"clientCfg"`
}

type SiteStore

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

func NewSiteStore

func NewSiteStore(store kvstore.IKVStore) (*SiteStore, error)

func (*SiteStore) GetCfg

func (st *SiteStore) GetCfg() (*SiteConfig, error)

func (*SiteStore) Init

func (st *SiteStore) Init(cfg *SiteConfig) error

func (*SiteStore) SetClientCfg

func (st *SiteStore) SetClientCfg(cfg *ClientConfig) error

Jump to

Keyboard shortcuts

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