envtab

package
v0.0.0-...-6322d52 Latest Latest
Warning

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

Go to latest
Published: Feb 22, 2024 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ENVTAB_DIR = ".envtab"
)

Variables

This section is empty.

Functions

func AddEntryToLoadout

func AddEntryToLoadout(name string, key string, value string, tags []string) error

Write a key-value pair to a loadout (and optionally any tags)

func CompareLoadouts

func CompareLoadouts(old Loadout, new Loadout) bool

func DisableLogin

func DisableLogin()

func EditLoadout

func EditLoadout(name string) error

Enter an interactive session to edit a loadout file

func EnableLogin

func EnableLogin()

func GetEnvtabSlice

func GetEnvtabSlice(path string) []string

Find all YAML files in the envtab directory, remove the extension, and return them as a slice

func InitEnvtab

func InitEnvtab(path string) string

Create the envtab directory if it doesn't exist and return the path

func RemoveLoadout

func RemoveLoadout(name string) error

Remove a loadout file

func RenameLoadout

func RenameLoadout(oldName, newName string) error

Rename a loadout file

func ShowLoginStatus

func ShowLoginStatus()

func WriteLoadout

func WriteLoadout(name string, loadout *Loadout) error

Write a Loadout struct to file

Types

type Loadout

type Loadout struct {
	Metadata LoadoutMetadata   `json:"metadata" yaml:"metadata"`
	Entries  map[string]string `json:"entries" yaml:"entries"`
}

func InitLoadout

func InitLoadout() *Loadout

Initialize a new Loadout struct

func MakeLoadoutFromTemplate

func MakeLoadoutFromTemplate(templateName string, force bool) Loadout

func ReadLoadout

func ReadLoadout(name string) (*Loadout, error)

Read a loadout from file and return a Loadout struct

func (Loadout) Export

func (l Loadout) Export()

func (*Loadout) PrintLoadout

func (l *Loadout) PrintLoadout() error

func (*Loadout) ReplaceTags

func (l *Loadout) ReplaceTags(tags []string) error

func (*Loadout) UpdateDescription

func (l *Loadout) UpdateDescription(description string) error

func (*Loadout) UpdateEntry

func (l *Loadout) UpdateEntry(key string, value string) error

func (*Loadout) UpdateLoadedAt

func (l *Loadout) UpdateLoadedAt() error

func (*Loadout) UpdateLogin

func (l *Loadout) UpdateLogin(login bool) error

func (*Loadout) UpdateTags

func (l *Loadout) UpdateTags(tags []string) error

func (*Loadout) UpdateUpdatedAt

func (l *Loadout) UpdateUpdatedAt() error

type LoadoutMetadata

type LoadoutMetadata struct {
	CreatedAt   string   `json:"createdAt" yaml:"createdAt"`
	LoadedAt    string   `json:"loadedAt" yaml:"loadedAt"`
	UpdatedAt   string   `json:"updatedAt" yaml:"updatedAt"`
	Login       bool     `json:"login" yaml:"login"`
	Tags        []string `json:"tags" yaml:"tags"`
	Description string   `json:"description" yaml:"description"`
}

type LoadoutTemplate

type LoadoutTemplate struct {
	Entries     []string `json:"entries" yaml:"entries"`
	Description string   `json:"description" yaml:"description"`
}

type LoadoutTemplates

type LoadoutTemplates struct {
	Templates map[string]LoadoutTemplate `json:"templates" yaml:"templates"`
}

Jump to

Keyboard shortcuts

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