siteconf

package module
v0.0.0-...-229476f Latest Latest
Warning

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

Go to latest
Published: Apr 20, 2022 License: MIT Imports: 17 Imported by: 1

README

siteconf

Ecletus plugin for site configuration

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Field

func Field(opt *FieldOptions) *admin.Meta

func GetFieldID

func GetFieldID(v interface{}) string

func MustPrivate

func MustPrivate(site *core.Site, key interface{}) (v string)

func Private

func Private(site *core.Site, key interface{}) (v string, ok bool)

func PrivateConfName

func PrivateConfName(v interface{}) string

func SetPrivate

func SetPrivate(site *core.Site, key, value interface{}) (err error)

func SetPrivateMap

func SetPrivateMap(site *core.Site, data map[interface{}]interface{}) (err error)

Types

type FieldOptions

type FieldOptions struct {
	Key             interface{}
	Meta            *admin.Meta
	Getter          Getter
	FormattedGetter FormattedGetter
}

func (FieldOptions) New

func (this FieldOptions) New() *admin.Meta

type FormattedGetter

type FormattedGetter func(context *core.Context, value interface{}) string

type Getter

type Getter func(context *core.Context, value string) interface{}

type Key

type Key uint8
const (
	OptFieldKey Key = iota
	OptFieldID
)

type Plugin

type Plugin struct {
	plug.EventDispatcher
	db.DBNames
	admin_plugin.AdminNames
	SitesRegisterKey,
	SitesLoaderUID string
	// contains filtered or unexported fields
}

func (*Plugin) After

func (p *Plugin) After() []string

func (*Plugin) Before

func (p *Plugin) Before() []string

func (*Plugin) Init

func (p *Plugin) Init(options *plug.Options)

func (*Plugin) OnRegister

func (p *Plugin) OnRegister(options *plug.Options)

func (*Plugin) RequireOptions

func (p *Plugin) RequireOptions() []string

type PrivateName

type PrivateName string

func (PrivateName) Concat

func (this PrivateName) Concat(sub string) PrivateName

func (PrivateName) Sub

func (this PrivateName) Sub(sub string) PrivateName

type SiteConfig

type SiteConfig struct {
	ID    string `sql:"size:512;primary_key"`
	Value string `sql:"text"`
}

func (SiteConfig) GetID

func (this SiteConfig) GetID() string

func (*SiteConfig) SetID

func (this *SiteConfig) SetID(value string)

type SiteConfigMain

type SiteConfigMain struct {
	fragment.FragmentedModel
	Title string
}

Jump to

Keyboard shortcuts

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