types

package
v0.15.0 Latest Latest
Warning

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

Go to latest
Published: Dec 8, 2023 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 Categories

type Categories []*Category

Categories collection of warp Categories

func (*Categories) InsertCategories

func (c *Categories) InsertCategories(newCategories Categories)

InsertCategories adds new categories to the slice.

func (*Categories) InsertCategory

func (c *Categories) InsertCategory(newCategory *Category)

InsertCategory adds a new category to the slice. If the title are same the entries will be merged.

func (Categories) Len

func (c Categories) Len() int

func (Categories) Less

func (c Categories) Less(i, j int) bool

func (Categories) Swap

func (c Categories) Swap(i, j int)

type Category

type Category struct {
	Title   string
	Order   int
	Entries Entries
}

Category categories multiple entries in the warp menu

func (Category) String

func (c Category) String() string

type DoguConverter

type DoguConverter struct{}

DoguConverter converts dogus from the configuration to a warp menu category object

func (*DoguConverter) ReadAndUnmarshalDogu

func (dc *DoguConverter) ReadAndUnmarshalDogu(registry WatchConfigurationContext, key string, tag string) (EntryWithCategory, error)

ReadAndUnmarshalDogu reads the dogu from the configuration. If it has the specific tag (or no tag) it will be converted to entry with a category for the warp menu

type Entries

type Entries []Entry

Entries is a collection of warp entries

func (Entries) Len

func (e Entries) Len() int

func (Entries) Less

func (e Entries) Less(i, j int) bool

func (Entries) Swap

func (e Entries) Swap(i, j int)

type Entry

type Entry struct {
	DisplayName string
	Href        string
	Title       string
	Target      Target
}

Entry link in the warp menu

type EntryWithCategory

type EntryWithCategory struct {
	Entry    Entry
	Category string
}

EntryWithCategory is a dto for entries with a Category

type ExternalConverter

type ExternalConverter struct{}

ExternalConverter is used to read external links from the configuration and convert them to a warp menu category object.

func (*ExternalConverter) ReadAndUnmarshalExternal

func (ec *ExternalConverter) ReadAndUnmarshalExternal(registry WatchConfigurationContext, key string) (EntryWithCategory, error)

ReadAndUnmarshalExternal reads a specific external link from the configuration and converts it to an entry with a category.

type Target

type Target uint8

Target defines the target of the link

const (
	// TARGET_SELF means the link is part of the internal system
	TARGET_SELF Target = iota + 1
	// TARGET_EXTERNAL link is outside from the system
	TARGET_EXTERNAL
)

func (Target) MarshalJSON

func (target Target) MarshalJSON() ([]byte, error)

type WatchConfigurationContext added in v0.10.0

type WatchConfigurationContext interface {
	registry.WatchConfigurationContext
}

Jump to

Keyboard shortcuts

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