graphsshortcut

package
v0.0.0-...-431bee0 Latest Latest
Warning

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

Go to latest
Published: Dec 17, 2024 License: BSD-3-Clause Imports: 5 Imported by: 0

Documentation

Overview

Package graphsshortcut handles storing and retrieving shortcuts for graphs.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type GraphConfig

type GraphConfig struct {
	Queries  []string `json:"queries"`
	Formulas []string `json:"formulas"`
	Keys     string   `json:"keys"`
}

GraphConfig represent the configurations used to populate a single graph.

type GraphsShortcut

type GraphsShortcut struct {
	Graphs []GraphConfig `json:"graphs"`
}

GraphsShortcut is a list of GraphConfigs, it is used in the Store interface.

func (GraphsShortcut) GetID

func (s GraphsShortcut) GetID() string

type Store

type Store interface {
	// InsertShortcut adds the shortcut content into the database. The id of the
	// shortcut is returned.
	InsertShortcut(ctx context.Context, shortcut *GraphsShortcut) (string, error)

	// GetShortcut retrieves parsed graph configs for the given id.
	GetShortcut(ctx context.Context, id string) (*GraphsShortcut, error)
}

Store is an interface for things that persists Graphs Shortcuts.

Directories

Path Synopsis
Package graphsshortcuttest has common code for tests of implementations of graphsshortcut.Store.
Package graphsshortcuttest has common code for tests of implementations of graphsshortcut.Store.

Jump to

Keyboard shortcuts

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