Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ConfigPath = "~/.cfconfig"
ConfigPath path to config data
View Source
var SessionPath = "~/.cfsession"
SessionPath path to config data
Functions ¶
Types ¶
type CodeTemplate ¶
type CodeTemplate struct { Alias string `json:"alias"` Lang string `json:"lang"` Path string `json:"path"` Suffix []string `json:"suffix"` BeforeScript string `json:"before_script"` Script string `json:"script"` AfterScript string `json:"after_script"` }
CodeTemplate config parse code template
type Config ¶
type Config struct { Username string `json:"username"` Password string `json:"password"` Template []CodeTemplate `json:"template"` Default int `json:"default"` // contains filtered or unexported fields }
Config load and save configuration
func (*Config) AddTemplate ¶ added in v0.4.0
AddTemplate add template
func (*Config) DecryptPassword ¶
DecryptPassword get real password
func (*Config) RemoveTemplate ¶ added in v0.4.0
RemoveTemplate remove template
func (*Config) SetDefaultTemplate ¶ added in v0.4.0
SetDefaultTemplate set default template index
func (*Config) TemplateByAlias ¶ added in v0.4.0
func (c *Config) TemplateByAlias(alias string) []CodeTemplate
TemplateByAlias return all template which alias equals to alias
Click to show internal directories.
Click to hide internal directories.