gviewx

package
v0.8.7 Latest Latest
Warning

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

Go to latest
Published: Nov 25, 2024 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

View Source
const ConfigNodeNameViewer = "viewer"
View Source
const (
	DefaultTemplatePath = "template"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Adapter

type Adapter interface {
	GetContent(key string) (content string, err error)
}

type AdapterDefault added in v0.4.2

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

func NewAdapterDefault added in v0.4.2

func NewAdapterDefault(adapter Adapter, fallbacks ...Adapter) *AdapterDefault

func (*AdapterDefault) GetContent added in v0.4.2

func (a *AdapterDefault) GetContent(key string) (content string, err error)

type AdapterFile

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

func NewAdapterFile

func NewAdapterFile(templatePath ...string) *AdapterFile

func (*AdapterFile) GetContent

func (a *AdapterFile) GetContent(key string) (content string, err error)

type Config

type Config struct {
	Data        map[string]interface{} `json:"data"`
	Delimiters  []string               `json:"delimiters"`
	AutoEncode  bool                   `json:"autoEncode"`
	I18nManager *gi18n.Manager         `json:"-"`
}

type View

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

func Instance

func Instance(name ...string) *View

func New

func New() *View

func NewWithAdapter

func NewWithAdapter(adapter Adapter) *View

func (*View) Assigns

func (view *View) Assigns(data gview.Params)

func (*View) GetAdapter

func (view *View) GetAdapter() Adapter

func (*View) Parse

func (view *View) Parse(ctx context.Context, key string, params ...gview.Params) (string, error)

func (*View) SetAdapter

func (view *View) SetAdapter(adapter Adapter) *View

func (*View) SetAutoEncode

func (view *View) SetAutoEncode(enable bool)

func (*View) SetConfig

func (view *View) SetConfig(config Config) *View

func (*View) SetConfigWithMap

func (view *View) SetConfigWithMap(m map[string]interface{}) error

func (*View) SetDelimiters

func (view *View) SetDelimiters(left, right string)

func (*View) SetI18n

func (view *View) SetI18n(manager *gi18n.Manager)

Jump to

Keyboard shortcuts

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