rc

package
v0.0.53 Latest Latest
Warning

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

Go to latest
Published: Aug 21, 2018 License: Apache-2.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type PivnetProfile

type PivnetProfile struct {
	Name     string `yaml:"name"`
	APIToken string `yaml:"api_token"`
	Host     string `yaml:"host"`
}

func (*PivnetProfile) Validate

func (p *PivnetProfile) Validate() error

type PivnetRC

type PivnetRC struct {
	Profiles []PivnetProfile `yaml:"profiles"`
}

type PivnetRCReadWriter

type PivnetRCReadWriter interface {
	WriteToFile(contents []byte) error
	ReadFromFile() ([]byte, error)
}

type RCHandler

type RCHandler struct {
	// contains filtered or unexported fields
}

func NewRCHandler

func NewRCHandler(rcReadWriter PivnetRCReadWriter) *RCHandler

func (*RCHandler) ProfileForName

func (h *RCHandler) ProfileForName(profileName string) (*PivnetProfile, error)

ProfileForName will return (nil,nil) if the file does not exist, or if the profile does not exist, but will return (nil,err) for other reasons e.g. the file cannot be read.

func (*RCHandler) RemoveProfileWithName

func (h *RCHandler) RemoveProfileWithName(profileName string) error

RemoveProfileWithName will return error for all errors except if file does not exist

func (*RCHandler) SaveProfile

func (h *RCHandler) SaveProfile(
	profileName string,
	apiToken string,
	host string,
) error

Directories

Path Synopsis
This file was generated by counterfeiter
This file was generated by counterfeiter

Jump to

Keyboard shortcuts

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