config

package
v0.9.1 Latest Latest
Warning

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

Go to latest
Published: Oct 10, 2016 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// CLIVersion is the version of the CLI.
	CLIVersion = "0.9.1"
	// DefaultApiServer is the default iobeam server.
	DefaultApiServer = "https://api.iobeam.com"
)

Variables

This section is empty.

Functions

func DeleteProfile added in v0.4.0

func DeleteProfile(name string) error

DeleteProfile removes a profile from the system.

func GetProfileList

func GetProfileList() ([]string, error)

GetProfileList returns a list of available profiles.

func InitConfig

func InitConfig() (*iobeamConfig, error)

InitConfig sets up the default config.

func ReadDefaultConfig

func ReadDefaultConfig() (*iobeamConfig, error)

func SwitchProfile

func SwitchProfile(name string) error

SwitchProfile attempts to change the active profile.

Types

type Profile

type Profile struct {
	Name            string `json:"-"`
	Server          string `json:"server"`
	ActiveProject   uint64 `json:"active_project"`
	ActiveUser      uint64 `json:"active_user"`
	ActiveUserEmail string `json:"activer_user_email"`
}

Profile represents a CLI profile, which is similar to a workspace that tracks active user, project, and other metadata.

func InitProfile

func InitProfile(name string) (*Profile, error)

InitProfile creates a new profile on the system named 'name'.

func InitProfileWithServer

func InitProfileWithServer(name, server string) (*Profile, error)

InitProfileWithServer creates a new profile on the system named 'name' and uses 'server' for the API server.

func ReadProfile

func ReadProfile(name string) (*Profile, error)

ReadProfile attempts to read and create a *Profile object.

func (*Profile) GetDir

func (p *Profile) GetDir() string

GetDir returns the path to where p's data is stored.

func (*Profile) GetFile

func (p *Profile) GetFile() string

GetFile returns the path to where p's metadata is stored.

func (*Profile) UpdateActiveProject

func (p *Profile) UpdateActiveProject(pid uint64) error

UpdateActiveProject changes the active project id of p.

func (*Profile) UpdateActiveUser

func (p *Profile) UpdateActiveUser(uid uint64, email string) error

UpdateActiveUser changes the active user id and email of p.

Jump to

Keyboard shortcuts

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