queryloader

package
v0.2.2 Latest Latest
Warning

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

Go to latest
Published: Jun 6, 2024 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func QueryToYamlLines

func QueryToYamlLines(q Query) []string

QueryToYamlLines converts a Query into a YAML string split into lines. It returns a slice of strings, each representing a line of the YAML output. If an error occurs during marshalling, the returned slice contains an error message.

Types

type Model

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

func New

func New(configQueries *QueriesConfig) Model

func (Model) Init

func (m Model) Init() tea.Cmd

func (Model) Update

func (m Model) Update(msg tea.Msg) (Model, tea.Cmd)

func (Model) View

func (m Model) View() string

type QueriesConfig

type QueriesConfig struct {
	Queries []Query `yaml:"queries"`
}

QueriesConfig represents a collection of queries

func LoadQueriesFromYaml

func LoadQueriesFromYaml(filename string) (*QueriesConfig, error)

type Query

type Query struct {
	Name   string `yaml:"name"`
	Script string `yaml:"script"`
}

Query represents a single varnishlog query

func (Query) Description

func (q Query) Description() string

Description satisfaces list.DefaultItem interface

func (Query) FilterValue

func (q Query) FilterValue() string

FilterValue satisfaces list.Item interface

func (Query) Title

func (q Query) Title() string

Title satisfaces list.DefaultItem interface

Jump to

Keyboard shortcuts

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