sitestore

package
v0.7.1 Latest Latest
Warning

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

Go to latest
Published: Mar 20, 2022 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" yaml:"url"`
	Repeat   string `json:"repeat" yaml:"repeat"`
	Position string `json:"position" yaml:"position"`
	Align    string `json:"align" yaml:"align"`
	BgColor  string `json:"bgColor" yaml:"bgColor"`
}

type ClientConfig

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

type ISiteStore

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

type SiteConfig

type SiteConfig struct {
	ClientCfg *ClientConfig `json:"clientCfg" yaml:"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