dashboard

package
v0.0.0-...-6ab062c Latest Latest
Warning

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

Go to latest
Published: Oct 12, 2023 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Dashboard

type Dashboard struct {
	FolderTitle     string `json:"-"`
	FolderDirectory string ""
	Title           string `json:"title"`
	UID             string `json:"uid"`
	Filename        string `json:"-"`
}

Dashboard contains the bare minimum information necessary to uniquely identify a Grafana dashboard and sync it disk.

func NewFromFile

func NewFromFile(baseDir, path string) (Dashboard, error)

func NewFromFoundBoard

func NewFromFoundBoard(db sdk.FoundBoard) Dashboard

type Set

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

Set represents a "unique" set of Dashboards, where the factor they are "unique" on is Filename.

func Difference

func Difference(set1 *Set, sets ...*Set) *Set

Difference returns a new Set which contains items which are in in the first set but not in the others.

func Intersection

func Intersection(sets ...*Set) *Set

Intersection returns a new Set which contains items that only exist in all given sets.

func NewSet

func NewSet(boards ...Dashboard) *Set

NewSet creates and initializes a new Set.

func NewSetWithSize

func NewSetWithSize(size int) *Set

NewSetWithSize creates a new Set with memory allocated for size items.

func SymmetricDifference

func SymmetricDifference(s *Set, t *Set) *Set

SymmetricDifference returns a new Set which s is the difference of items which are in one of either, but not in both.

func Union

func Union(sets ...*Set) *Set

Union is the merger of multiple sets. It returns a new Set with all the elements present in all the sets that are passed.

func (*Set) Add

func (s *Set) Add(items ...Dashboard)

Add includes the specified items (one or more) to the Set. The underlying Set s is modified. If passed nothing it silently returns.

func (*Set) Clear

func (s *Set) Clear()

Clear removes all items from the Set.

func (*Set) Copy

func (s *Set) Copy() *Set

Copy returns a new Set with a copy of s.

func (*Set) Each

func (s *Set) Each(f func(item Dashboard) bool)

Each traverses the items in the Set, calling the provided function for each Set member. Traversal will continue until all items in the Set have been visited, or if the closure returns false.

func (*Set) Has

func (s *Set) Has(items ...Dashboard) bool

Has looks for the existence of items passed. It returns false if nothing is passed. For multiple items it returns true only if all of the items exist.

func (*Set) HasAny

func (s *Set) HasAny(items ...Dashboard) bool

HasAny looks for the existence of any of the items passed. It returns false if nothing is passed. For multiple items it returns true if any of the items exist.

func (*Set) IsEmpty

func (s *Set) IsEmpty() bool

IsEmpty reports whether the Set is empty.

func (*Set) IsEqual

func (s *Set) IsEqual(t *Set) bool

IsEqual test whether s and t are the same in size and have the same items.

func (*Set) IsSubset

func (s *Set) IsSubset(t *Set) bool

IsSubset tests whether t is a subset of s.

func (*Set) IsSuperset

func (s *Set) IsSuperset(t *Set) bool

IsSuperset tests whether t is a superset of s.

func (*Set) List

func (s *Set) List() []Dashboard

List returns a slice of all items. There is also StringSlice() and IntSlice() methods for returning slices of type string or int.

func (*Set) Merge

func (s *Set) Merge(t *Set)

Merge is like Union, however it modifies the current Set it's applied on with the given t Set.

func (*Set) Pop

func (s *Set) Pop() Dashboard

Pop deletes and returns an item from the Set. The underlying Set s is modified. If Set is empty, the zero value is returned.

func (*Set) Pop2

func (s *Set) Pop2() (Dashboard, bool)

Pop2 tries to delete and return an item from the Set. The underlying Set s is modified. The second value is a bool that is true if the item existed in the set, and false if not. If Set is empty, the zero value and false are returned.

func (*Set) Remove

func (s *Set) Remove(items ...Dashboard)

Remove deletes the specified items from the Set. The underlying Set s is modified. If passed nothing it silently returns.

func (*Set) Separate

func (s *Set) Separate(t *Set)

Separate removes the Set items containing in t from Set s. Please aware that it's not the opposite of Merge.

func (*Set) Size

func (s *Set) Size() int

Size returns the number of items in a Set.

func (*Set) String

func (s *Set) String() string

String returns a string representation of s

Jump to

Keyboard shortcuts

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