persona

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Mar 5, 2024 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Create

func Create(p Persona) error

Create creates specific persona configuration in the personas_location folder It does not override an existing persona If a folder with the same name exists but is not a persona, proceeds.

func Delete

func Delete(p Persona) error

Delete deletes specified persona configuration It does not delete files within the persona's folder.

Types

type Identity

type Identity struct {
	Email string
	Name  string
}

Indentity holds information about the indentity the persona refers to.

type Persona

type Persona struct {
	Config *viper.Viper
	// contains filtered or unexported fields
}

Persona holds the entire persona information.

func Load

func Load(name string) (Persona, error)

func New

func New(name string) (Persona, error)

func NewWithCustomLocation

func NewWithCustomLocation(name, location string) (Persona, error)

func (Persona) Exists

func (p Persona) Exists() bool

Exists verify if a persona exists in the specified location For a persona to exists the configuration file should be present Persona configuration file is not validated.

func (Persona) File

func (p Persona) File() string

File return profile configuration file path.

func (Persona) Load

func (p Persona) Load() error

func (Persona) Location

func (p Persona) Location() string

Location return persona's folder.

func (Persona) Name

func (p Persona) Name() string

Name return persona's name.

func (Persona) Whoami

func (p Persona) Whoami() string

Whoami returns human readable identity information.

Jump to

Keyboard shortcuts

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