cache

package
v0.0.0-...-f2f9183 Latest Latest
Warning

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

Go to latest
Published: Feb 17, 2022 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Template

type Template struct {
	Handler             string            `firestore:"handler-name,omitempty" json:"handler-name,omitempty"`
	CalculatedVariables []string          `firestore:"calculated-variables,omitempty" json:"calculated-variables,omitempty"`
	SessionVariables    map[string]string `firestore:"session-variables,omitempty" json:"mapped-variables,omitempty"`
	Prototype           string            `firestore:"prototype,omitempty" json:"prototype,omitempty"`
	// contains filtered or unexported fields
}

func (*Template) Compile

func (t *Template) Compile(ep string)

func (*Template) Equals

func (t *Template) Equals(o *Template) bool

func (*Template) Execute

func (t *Template) Execute(d map[string]string) bytes.Buffer

Execute infers arguments from the provided prototype, checks the provided map for required arguments, and then Executes the template.

func (*Template) FromMap

func (t *Template) FromMap(ep string, m map[string]interface{})

func (*Template) MapSessionVariables

func (t *Template) MapSessionVariables(wr *cx.WebhookRequest) map[string]string

Extracts Session Variables

type TemplateCache

type TemplateCache struct {
	AgentName string
	Cache     TemplateDefinitions
	// contains filtered or unexported fields
}

func (*TemplateCache) CacheCopier

func (c *TemplateCache) CacheCopier(w io.Writer)

func (*TemplateCache) Listen

func (c *TemplateCache) Listen(ctx context.Context, client *firestore.Client)

Listen listen's for updates to string template definitions in Firestore and updates the template cache in a concurrent safe manner. It returns a channel which is used to sync completion of the initial data load.

func (*TemplateCache) Load

func (c *TemplateCache) Load(name string) (tmp Template, ok bool)

func (*TemplateCache) Store

func (c *TemplateCache) Store(ep string, tmp Template)

type TemplateDefinitions

type TemplateDefinitions map[string]Template

Separated type for testing purposes.

Jump to

Keyboard shortcuts

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