interpolator

package
v1.17.0 Latest Latest
Warning

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

Go to latest
Published: Aug 10, 2024 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Interpolator

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

func New

func New(state map[string]string, secrets map[string]types.Secret, upd *telegram.Update) *Interpolator

New interpolator with state and secrets. deprecated: use NewWithOps

func NewWithOps added in v1.16.0

func NewWithOps(ops ...InterpolatorOp) *Interpolator

NewWithOps interpolator with options.

func (*Interpolator) Interpolate

func (i *Interpolator) Interpolate(text string) string

func (*Interpolator) InterpolateS added in v1.16.0

func (i *Interpolator) InterpolateS(s fmt.Stringer) string

type InterpolatorOp added in v1.16.0

type InterpolatorOp func(*Interpolator)

func WithData added in v1.16.0

func WithData(data map[string]string) InterpolatorOp

func WithSecrets added in v1.16.0

func WithSecrets(secrets map[string]types.Secret) InterpolatorOp

func WithState added in v1.16.0

func WithState(state map[string]string) InterpolatorOp

func WithUpdate added in v1.16.0

func WithUpdate(upd *telegram.Update) InterpolatorOp

Jump to

Keyboard shortcuts

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