Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var (
EXECUTABLE, _ = os.Executable()
WORKING_DIR, _ = os.Getwd()
HOME_DIR, _ = os.UserHomeDir()
)
Functions ¶
This section is empty.
Types ¶
type ConfigType ¶
type ConfigType string
const ( ProjectConfig ConfigType = "ProjectConfig" AccountConfig ConfigType = "AccountConfig" KeysConfig ConfigType = "KeysConfig" ContingencyConfig ConfigType = "ContingencyConfig" CONFIG_FOLDER_NAME = ".envs" )
type Keys ¶
type Keys struct {
Public []byte `json:"public_key" yaml:"public_key"`
Private []byte `json:"private_key" yaml:"private_key"`
}
func (p *ProjectStringified) Unstringify() (*Project, error) {
key, err := base64.StdEncoding.DecodeString(p.Key)
if err != nil {
return nil, err
}
return &Project{
Organisation: p.Organisation,
Project: p.Project,
Key: key,
AutoCapitalize: p.AutoCapitalize,
}, nil
}
func (p *Project) Stringify() *ProjectStringified {
return &ProjectStringified{
Organisation: p.Organisation,
Project: p.Project,
Key: base64.StdEncoding.EncodeToString(p.Key),
AutoCapitalize: p.AutoCapitalize,
}
}
func (*Keys) Stringify ¶
func (k *Keys) Stringify() *KeysStringified
type KeysStringified ¶
type KeysStringified struct {
Public string `json:"public_key" yaml:"public_key"`
Private string `json:"private_key" yaml:"private_key"`
}
func (*KeysStringified) Unstringify ¶
func (k *KeysStringified) Unstringify() (*Keys, error)
type Project ¶
type Project struct {
//OrgID string `json:"org_id" yaml:"org_id"`
ProjectID string `json:"project_id" yaml:"project_id"`
Key []byte `json:"key" yaml:"key"`
}
func (*Project) MarshalJSON ¶
Custom json marshalling. We need to do this because we want to store the org key as a base64 encoded string in the config file. We can't store it as a byte array because yaml marshalling will convert it to a string.
func (*Project) UnmarshalJSON ¶
Custom json unmarshalling. We need to do this because we want to store the org key as a base64 encoded string in the config file.
Click to show internal directories.
Click to hide internal directories.