Documentation ¶
Index ¶
- Constants
- Variables
- func GetOutputFormats() []string
- func GetYaml(v interface{}) (string, error)
- func LoadConfig(configFile string) error
- func MarshalModel(obj interface{}, indent bool) string
- func PathExtSplit(file string) (string, string)
- func PrintPrettyItemTable(table PrettyItemTable)
- func PrintPrettyTable(table PrettyTable, long bool)
- func PrintPrettyTableFormat(table PrettyTable, long bool, format string)
- func RegistryLongFlag(cmd ...*cobra.Command)
- func SplitKeyValue(kv string) ([]string, error)
- type Auth
- type Column
- type ConfGroup
- type Iperf
- type PrettyItemTable
- type PrettyTable
- func (pt *PrettyTable) AddItems(items interface{})
- func (pt *PrettyTable) CleanItems()
- func (pt PrettyTable) GetLongColumnIndex(column string) int
- func (pt PrettyTable) GetShortColumnIndex(column string) int
- func (pt PrettyTable) Print(long bool)
- func (pt PrettyTable) PrintJson()
- func (pt PrettyTable) PrintYaml()
- func (pt *PrettyTable) ReInit()
- func (pt *PrettyTable) SetStyleLight()
- type Server
Constants ¶
View Source
const ( DEFAULT = "default" TABLE = "table" TABLE_LIGHT = "table-light" JSON = "json" YAML = "yaml" )
Variables ¶
View Source
var ( CONF ConfGroup CONF_FILE string )
View Source
var ( FORMAT_TABLE_LIGHT = "table-light" FORMAT_TABLE = "table" DEFAULT_TOKEN_EXPIRE_TIME = 60 * 30 )
View Source
var CONF_FILES = []string{
"etc/skyman.yaml",
"/etc/skyman/skyman.yaml",
}
View Source
var (
STYLE_LIGHT = "light"
)
Functions ¶
func GetOutputFormats ¶
func GetOutputFormats() []string
func LoadConfig ¶
func MarshalModel ¶
func PathExtSplit ¶
func PrintPrettyItemTable ¶
func PrintPrettyItemTable(table PrettyItemTable)
func PrintPrettyTable ¶
func PrintPrettyTable(table PrettyTable, long bool)
func PrintPrettyTableFormat ¶
func PrintPrettyTableFormat(table PrettyTable, long bool, format string)
func RegistryLongFlag ¶
func SplitKeyValue ¶
Types ¶
type Column ¶
type Column struct { Name string Text string // 只有 Table.Style 等于 light 是才会生效 AutoColor bool ForceColor bool Slot func(item interface{}) interface{} SlotColumn func(item interface{}, column Column) interface{} Sort bool SortMode table.SortMode Filters []string Marshal bool WidthMax int Align text.Align }
type PrettyItemTable ¶
type PrettyItemTable struct { ShortFields []Column LongFields []Column Item interface{} Title string Style string Number2WidthMax int }
func (PrettyItemTable) Print ¶
func (pt PrettyItemTable) Print(long bool)
func (PrettyItemTable) PrintJson ¶
func (dt PrettyItemTable) PrintJson()
func (PrettyItemTable) PrintYaml ¶
func (dt PrettyItemTable) PrintYaml()
type PrettyTable ¶
type PrettyTable struct { Title string ShortColumns []Column LongColumns []Column Items []interface{} ColumnConfigs []table.ColumnConfig Style string StyleSeparateRows bool HideTotalItems bool Filters map[string]string Search string // contains filtered or unexported fields }
func (*PrettyTable) AddItems ¶
func (pt *PrettyTable) AddItems(items interface{})
func (*PrettyTable) CleanItems ¶
func (pt *PrettyTable) CleanItems()
func (PrettyTable) GetLongColumnIndex ¶
func (pt PrettyTable) GetLongColumnIndex(column string) int
func (PrettyTable) GetShortColumnIndex ¶
func (pt PrettyTable) GetShortColumnIndex(column string) int
func (PrettyTable) Print ¶
func (pt PrettyTable) Print(long bool)
func (PrettyTable) PrintJson ¶
func (pt PrettyTable) PrintJson()
func (PrettyTable) PrintYaml ¶
func (pt PrettyTable) PrintYaml()
func (*PrettyTable) ReInit ¶
func (pt *PrettyTable) ReInit()
func (*PrettyTable) SetStyleLight ¶
func (pt *PrettyTable) SetStyleLight()
type Server ¶
type Server struct { Flavor string `yaml:"flavor"` Image string `yaml:"image"` Network string `yaml:"network"` VolumeBoot bool `yaml:"volumeBoot"` VolumeType string `yaml:"volumeType"` VolumeSize uint16 `yaml:"volumeSize"` AvailabilityZone string `yaml:"availabilityZone"` NamePrefix string `yaml:"namePrefix"` }
Click to show internal directories.
Click to hide internal directories.