Documentation
¶
Index ¶
- Constants
- Variables
- func ClientWithRegion(region string) *openstack.Openstack
- func DefaultClient() *openstack.Openstack
- func GetOutputFormats() []string
- func GetYaml(v interface{}) (string, error)
- func LastItems(items []interface{}, last int) []interface{}
- func LoadConfig(configFile string) error
- func MarshalModel(obj interface{}, indent bool) string
- func NewCommand[T any](command Cli[T]) *cobra.Command
- func PathExtSplit(file string) (string, string)
- func PrintAgents(items []neutron.Agent, long bool)
- func PrintAggregate(item nova.Aggregate)
- func PrintAggregates(items []nova.Aggregate, long bool)
- func PrintBackup(backup cinder.Backup)
- func PrintBackups(items []cinder.Backup, long bool)
- func PrintEndpoint(item keystone.Endpoint, serviceMap map[string]keystone.Service)
- func PrintEndpoints(items []keystone.Endpoint, long bool, serviceMap map[string]keystone.Service)
- func PrintImage(item glance.Image, human bool)
- func PrintImages(items []glance.Image, long bool)
- func PrintItem[T any](fields, moreFields []datatable.Field[T], item T, opt TableOptions)
- func PrintItems[T any](columns, moreColumns []datatable.Column[T], items []T, opt TableOptions)
- func PrintKeypair(item nova.Keypair)
- func PrintNetwork(item neutron.Network)
- func PrintNetworks(items []neutron.Network, long bool)
- func PrintPort(item neutron.Port)
- func PrintPorts(items []neutron.Port, long bool)
- func PrintPrettyItemTable(table PrettyItemTable) string
- func PrintPrettyTable(table PrettyTable, long bool) string
- func PrintPrettyTableFormat(table PrettyTable, long bool, format string) string
- func PrintProject(item model.Project)
- func PrintProjects(items []model.Project, long bool)
- func PrintQosPolicy(item neutron.QosPolicy)
- func PrintQosPolicyRule(item neutron.QosRule)
- func PrintQosPolicyRules(items []neutron.QosRule, long bool)
- func PrintQosPolicys(items []neutron.QosPolicy, long bool)
- func PrintQuotaSet(item nova.QuotaSet, more bool)
- func PrintRegions(items []keystone.Region, long bool)
- func PrintRouter(item neutron.Router)
- func PrintRouters(items []neutron.Router, long bool)
- func PrintSecurityGroup(item neutron.SecurityGroup)
- func PrintSecurityGroupRule(item neutron.SecurityGroupRule)
- func PrintSecurityGroupRules(items []neutron.SecurityGroupRule, long bool)
- func PrintSecurityGroups(items []neutron.SecurityGroup, long bool)
- func PrintServers(items []nova.Server, long bool, c *openstack.Openstack, sortDsc bool)
- func PrintService(item keystone.Service)
- func PrintServices(items []keystone.Service, long bool)
- func PrintSnapshot(snapshot cinder.Snapshot)
- func PrintSnapshots(items []cinder.Snapshot, long bool)
- func PrintSubnet(item neutron.Subnet)
- func PrintSubnets(items []neutron.Subnet, long bool)
- func PrintUser(item model.User)
- func PrintUsers(items []model.User, long bool)
- func PrintVolume(volume cinder.Volume)
- func PrintVolumeServices(items []cinder.Service, long bool)
- func PrintVolumeType(volumeType cinder.VolumeType)
- func PrintVolumeTypes(items []cinder.VolumeType, long bool)
- func PrintVolumes(items []cinder.Volume, long bool)
- func RegistryLongFlag(cmd ...*cobra.Command)
- func RepeatFunc(nums int, function func())
- func SplitKeyValue(kv string) ([]string, error)
- func ValidIpv4(cidr string, maxMask ...int) bool
- type Api
- type Auth
- type Case
- type CaseConfig
- type Cli
- type Column
- type ConfGroup
- type DataRender
- type Identity
- type InterfaceHotplug
- type LiveMigrateOptions
- type NeutronConf
- type PrettyItemTable
- type PrettyTable
- func (pt *PrettyTable) AddDisplayFields(fields ...string)
- 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) string
- func (pt PrettyTable) PrintJson() string
- func (pt PrettyTable) PrintYaml() string
- func (pt *PrettyTable) ReInit()
- func (pt PrettyTable) RenderToJson() (string, error)
- func (pt PrettyTable) RenderToTable(long bool) string
- func (pt PrettyTable) RenderToYaml() (string, error)
- func (pt *PrettyTable) SetStyleLight()
- type QGAChecker
- type RevertSystemConf
- type ServerActionsTestConf
- type TableOptions
- type VolumeHotplug
- type Web
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 ( DEFAULT_GUEST_CONNECT_TIMEOUT = 60 * 5 DEFAULT_QGA_CONNECT_TIMEOUT = 60 * 10 DEFAULT_PING_INTERVAL = float32(1.0) )
View Source
var CONF_FILES = []string{
"etc/skyman.yaml",
"/etc/skyman/skyman.yaml",
}
View Source
var (
STYLE_LIGHT = "light"
)
Functions ¶
func ClientWithRegion ¶
func DefaultClient ¶
func GetOutputFormats ¶
func GetOutputFormats() []string
func LoadConfig ¶
func MarshalModel ¶
func PathExtSplit ¶
func PrintAgents ¶
func PrintAggregate ¶
func PrintAggregates ¶
func PrintBackup ¶
func PrintBackups ¶
func PrintEndpoint ¶
func PrintEndpoints ¶
func PrintImage ¶
func PrintImages ¶
func PrintItem ¶
func PrintItem[T any](fields, moreFields []datatable.Field[T], item T, opt TableOptions)
func PrintItems ¶
func PrintItems[T any](columns, moreColumns []datatable.Column[T], items []T, opt TableOptions)
func PrintKeypair ¶
func PrintNetwork ¶
func PrintNetworks ¶
func PrintPorts ¶
func PrintPrettyItemTable ¶
func PrintPrettyItemTable(table PrettyItemTable) string
func PrintPrettyTable ¶
func PrintPrettyTable(table PrettyTable, long bool) string
func PrintPrettyTableFormat ¶
func PrintPrettyTableFormat(table PrettyTable, long bool, format string) string
func PrintProject ¶
func PrintProjects ¶
func PrintQosPolicy ¶
func PrintQosPolicyRule ¶
func PrintQosPolicyRules ¶
func PrintQosPolicys ¶
func PrintQuotaSet ¶
func PrintRouter ¶
func PrintRouters ¶
func PrintSecurityGroup ¶
func PrintSecurityGroup(item neutron.SecurityGroup)
func PrintSecurityGroupRule ¶
func PrintSecurityGroupRule(item neutron.SecurityGroupRule)
func PrintSecurityGroupRules ¶
func PrintSecurityGroupRules(items []neutron.SecurityGroupRule, long bool)
func PrintSecurityGroups ¶
func PrintSecurityGroups(items []neutron.SecurityGroup, long bool)
func PrintServers ¶
nova
func PrintService ¶
func PrintServices ¶
func PrintSnapshot ¶
func PrintSnapshots ¶
func PrintSubnet ¶
func PrintSubnets ¶
func PrintUsers ¶
func PrintVolume ¶
func PrintVolumeServices ¶
func PrintVolumeType ¶
func PrintVolumeType(volumeType cinder.VolumeType)
func PrintVolumeTypes ¶
func PrintVolumeTypes(items []cinder.VolumeType, long bool)
func PrintVolumes ¶
func RegistryLongFlag ¶
func RepeatFunc ¶
func RepeatFunc(nums int, function func())
func SplitKeyValue ¶
Types ¶
type Case ¶
type Case struct { Name string `yaml:"name"` Actions string `yaml:"actions"` Skip bool `yaml:"skip"` Config CaseConfig `yaml:"config"` }
type CaseConfig ¶
type CaseConfig struct { Flavors []string `yaml:"flavors"` Images []string `yaml:"images"` Workers int `yaml:"workers"` ActionInterval int `yaml:"actionInterval"` DeleteIfError bool `yaml:"deleteIfError"` DeleteIfSuccess bool `yaml:"deleteIfSuccess"` AvailabilityZone string `yaml:"availabilityZone"` BootFromVolume bool `yaml:"bootFromVolume"` BootVolumeSize uint16 `yaml:"bootVolumeSize"` BootVolumeType string `yaml:"bootVolumeType"` BootWithSG string `yaml:"bootWithSG"` Networks []string `yaml:"networks"` VolumeType string `yaml:"volumeType"` VolumeSize int `yaml:"volumeSize"` InterfaceHotplug InterfaceHotplug `yaml:"interfaceHotplug"` VolumeHotplug VolumeHotplug `yaml:"volumeHotplug"` QGAChecker QGAChecker `yaml:"qgaChecker"` LiveMigrate LiveMigrateOptions `yaml:"liveMigrate"` RevertSystem RevertSystemConf `yaml:"revertSystem"` }
func NewActionCaseConfig ¶
func NewActionCaseConfig(config CaseConfig, def CaseConfig) CaseConfig
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 ConfGroup ¶
type ConfGroup struct { Debug bool `yaml:"debug"` Format string `yaml:"format"` Language string `yaml:"language"` HttpTimeoutSecond int `yaml:"httpTimeoutSecond"` RetryWaitTimeSecond int `yaml:"retryWaitTimeSecond"` RetryCount int `yaml:"retryCount"` LogFile string `yaml:"logFile"` EnableLogColor bool `yaml:"enableLogColor"` BarChar string `yaml:"barchar"` Auth Auth `yaml:"auth"` Identity Identity `yaml:"identity"` Neutron NeutronConf `yaml:"neutron"` }
func DefaultConfGroup ¶
func DefaultConfGroup() ConfGroup
type DataRender ¶
type InterfaceHotplug ¶
type InterfaceHotplug struct {
Nums int `yaml:"nums"`
}
type LiveMigrateOptions ¶
type NeutronConf ¶
type NeutronConf struct {
Endpoint string `yaml:"endpoint"`
}
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) string
func (PrettyItemTable) PrintJson ¶
func (dt PrettyItemTable) PrintJson() string
func (PrettyItemTable) PrintYaml ¶
func (dt PrettyItemTable) PrintYaml() string
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 DisplayFields []string // contains filtered or unexported fields }
func (*PrettyTable) AddDisplayFields ¶
func (pt *PrettyTable) AddDisplayFields(fields ...string)
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) string
func (PrettyTable) PrintJson ¶
func (pt PrettyTable) PrintJson() string
func (PrettyTable) PrintYaml ¶
func (pt PrettyTable) PrintYaml() string
func (*PrettyTable) ReInit ¶
func (pt *PrettyTable) ReInit()
func (PrettyTable) RenderToJson ¶
func (pt PrettyTable) RenderToJson() (string, error)
func (PrettyTable) RenderToTable ¶
func (pt PrettyTable) RenderToTable(long bool) string
func (PrettyTable) RenderToYaml ¶
func (pt PrettyTable) RenderToYaml() (string, error)
func (*PrettyTable) SetStyleLight ¶
func (pt *PrettyTable) SetStyleLight()
type QGAChecker ¶
type RevertSystemConf ¶
type RevertSystemConf struct {
RepeatEveryTime int `yaml:"repeatEveryTime"`
}
type ServerActionsTestConf ¶
type ServerActionsTestConf struct { Web Web `yaml:"web"` Default CaseConfig `yaml:"default"` Cases []Case `yaml:"cases"` }
func LoadTaskConfig ¶
func LoadTaskConfig(taskFile string) (*ServerActionsTestConf, error)
type TableOptions ¶
type VolumeHotplug ¶
type VolumeHotplug struct {
Nums int `yaml:"nums"`
}
Source Files
¶
Click to show internal directories.
Click to hide internal directories.