preference

package
v0.0.0-...-575b356 Latest Latest
Warning

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

Go to latest
Published: Jun 15, 2024 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CreateOrUpdate

func CreateOrUpdate(orgID, orgSubdomain string) error

func Found

func Found(mayHaveFound interface{}) bool

func Write

func Write(data *Data) error

Types

type Data

type Data struct {
	Orgs              map[string]Org    `json:"orgs"`
	Sockets           map[string]Socket `json:"sockets"`
	PreferredTerminal string            `json:"preferred_terminal"`
	PathEnvConfigured bool              `json:"path_env_configured"`
}

func NewData

func NewData() *Data

func Read

func Read() (*Data, error)

func (*Data) GetOrSuggestSocket

func (d *Data) GetOrSuggestSocket(dnsName string, socketType string) *Socket

func (*Data) Org

func (d *Data) Org(orgID string) *Org

func (*Data) RecentlyUsedOrgs

func (d *Data) RecentlyUsedOrgs(numOfOrgs int) Orgs

func (*Data) SetOrg

func (d *Data) SetOrg(input *Org)

func (*Data) SetSocket

func (d *Data) SetSocket(input *Socket)

func (*Data) Socket

func (d *Data) Socket(dnsName string) *Socket

func (*Data) SuggestSocket

func (d *Data) SuggestSocket(dnsName, socketType string) *Socket

type Org

type Org struct {
	ID        string    `json:"id"`
	Subdomain string    `json:"subdomain"`
	LastUsed  time.Time `json:"last_used"`
}

func NewOrg

func NewOrg(id string) *Org

type Orgs

type Orgs []Org

func (Orgs) Subdomains

func (o Orgs) Subdomains() []string

type Socket

type Socket struct {
	DNSName        string    `json:"dns_name"`
	Username       string    `json:"username"`
	LastUsed       time.Time `json:"last_used"`
	SocketType     string    `json:"socket_type"`
	DatabaseName   string    `json:"database_name"`
	DatabaseClient string    `json:"database_client"`
}

func NewDatabaseSocket

func NewDatabaseSocket(dnsName string) *Socket

func NewSSHSocket

func NewSSHSocket(dnsName string) *Socket

Jump to

Keyboard shortcuts

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