templates

package
v1.3.7 Latest Latest
Warning

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

Go to latest
Published: Dec 6, 2023 License: BSD-3-Clause Imports: 5 Imported by: 3

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetTemplates

func GetTemplates() []string

func ParseTemplateKey

func ParseTemplateKey(key string, k *TemplateKey) error

func RegisterTemplateDriver

func RegisterTemplateDriver(name string, t TemplateDriver)

Types

type TemplateDriver

type TemplateDriver interface {
	TemplateInterface

	Prepare() error              // Prepare driver (eg: flag registration)
	Init(context.Context) error  // Initialize driver (eg: parse keying)
	Close(context.Context) error // Close drive (eg: close file)
}

type TemplateInterface

type TemplateInterface interface {
	ListTemplates(ctx context.Context, ch chan *TemplateKey) error
	GetTemplate(ctx context.Context, key *TemplateKey) (interface{}, error)
	AddTemplate(ctx context.Context, key *TemplateKey, template interface{}) error // add expiration
}

type TemplateKey

type TemplateKey struct {
	TemplateKey string
	Version     uint16
	ObsDomainId uint32
	TemplateId  uint16
}

func NewTemplateKey

func NewTemplateKey(templateKey string, version uint16, obsDomainId uint32, templateId uint16) *TemplateKey

func (*TemplateKey) String

func (k *TemplateKey) String() string

type TemplateSystem

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

func FindTemplateSystem

func FindTemplateSystem(ctx context.Context, name string) (*TemplateSystem, error)

func (*TemplateSystem) AddTemplate

func (t *TemplateSystem) AddTemplate(ctx context.Context, key *TemplateKey, template interface{}) error

func (*TemplateSystem) Close

func (t *TemplateSystem) Close(ctx context.Context) error

func (*TemplateSystem) GetTemplate

func (t *TemplateSystem) GetTemplate(ctx context.Context, key *TemplateKey) (interface{}, error)

func (*TemplateSystem) ListTemplates

func (t *TemplateSystem) ListTemplates(ctx context.Context, ch chan *TemplateKey) error

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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