Documentation
¶
Overview ¶
Copyright 2017 The Goock Authors.
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
Index ¶
- func RegMatcher(text string, matcher string) []string
- func RegSplit(text string, delimiter string) []string
- func SetExecutor(e exec.Interface)
- func SetLogger(l *logrus.Logger)
- func SetValue(field reflect.Value, value interface{})
- type DeviceInfo
- type FibreChannelTarget
- type HBA
- type ISCSISession
- type Interface
- type LineParser
- type Multipath
- type PairParser
- type Parser
- type SinglePath
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func RegMatcher ¶
RegMatcher returns slices of string between adjacent matchers
func SetExecutor ¶
Types ¶
type DeviceInfo ¶
type DeviceInfo struct {
Device string
Host string
Channel int
Target int
Lun int
// contains filtered or unexported fields
}
func NewDeviceInfo ¶
func NewDeviceInfo(path string) []DeviceInfo
func (*DeviceInfo) GetCommand ¶
func (d *DeviceInfo) GetCommand() []string
func (*DeviceInfo) GetDeviceIdentifier ¶
func (d *DeviceInfo) GetDeviceIdentifier() string
Returns a string with format: <host>:<channel>:<Target>:<Lun>
func (*DeviceInfo) GetHostId ¶
func (d *DeviceInfo) GetHostId() int
func (*DeviceInfo) GetPattern ¶
func (d *DeviceInfo) GetPattern() interface{}
func (*DeviceInfo) GetValue ¶
func (d *DeviceInfo) GetValue(key string) interface{}
func (*DeviceInfo) Parse ¶
func (d *DeviceInfo) Parse() []DeviceInfo
type FibreChannelTarget ¶ added in v0.1.1
type FibreChannelTarget struct {
ClassDevice string
ClassDevicePath string
NodeName string
PortId string
PortName string
Device string
DevicePath string
// contains filtered or unexported fields
}
(FibreChannelTarget) Subclass of Interface Represents the FC targets connected with HBA
func NewFibreChannelTarget ¶ added in v0.1.1
func NewFibreChannelTarget() []FibreChannelTarget
func (*FibreChannelTarget) GetCommand ¶ added in v0.1.1
func (s *FibreChannelTarget) GetCommand() []string
func (*FibreChannelTarget) GetHostChannelTarget ¶ added in v0.1.1
func (s *FibreChannelTarget) GetHostChannelTarget() ([]int, error)
Parse Device "target9:0:0" to []int{9, 0, 0}
func (*FibreChannelTarget) GetPattern ¶ added in v0.1.1
func (s *FibreChannelTarget) GetPattern() interface{}
func (*FibreChannelTarget) GetValue ¶ added in v0.1.1
func (s *FibreChannelTarget) GetValue(key string) interface{}
func (*FibreChannelTarget) Parse ¶ added in v0.1.1
func (s *FibreChannelTarget) Parse() []FibreChannelTarget
type HBA ¶
type HBA struct {
Name string
Path string
FabricName string
NodeName string
PortName string
PortState string
Speed string
SupportedSpeeds string
DevicePath string
// contains filtered or unexported fields
}
(HBA) Subclass of Interface
func (*HBA) GetCommand ¶
func (*HBA) GetPattern ¶
func (s *HBA) GetPattern() interface{}
type ISCSISession ¶
type ISCSISession struct {
TargetIqn string
TargetPortal string
TargetIp string
Tag string
// contains filtered or unexported fields
}
Implementation of ISCSISession
func DiscoverISCSISession ¶
func DiscoverISCSISession(targetPortals []string) []ISCSISession
Discover all the targets provided by targetPortals Use goroutine to accelerate the target discovery process. the "--op new" is important, or the existing node info will be overwritten after the discovery.
func NewISCSISession ¶
func NewISCSISession() []ISCSISession
func (*ISCSISession) GetCommand ¶
func (iscsi *ISCSISession) GetCommand() []string
func (*ISCSISession) GetPattern ¶
func (iscsi *ISCSISession) GetPattern() interface{}
func (*ISCSISession) GetValue ¶
func (iscsi *ISCSISession) GetValue(key string) interface{}
func (*ISCSISession) Parse ¶
func (iscsi *ISCSISession) Parse() []ISCSISession
type Interface ¶
type Interface interface {
GetPattern() interface{}
GetCommand() []string
GetValue(key string) interface{}
Parse() []interface{}
// contains filtered or unexported methods
}
Interface declaration
type LineParser ¶
LineParse parse each line as a single data map The data map could be used to initialize a new Object derived from Interface
func (*LineParser) Parse ¶
func (p *LineParser) Parse(output string, pat interface{}) []map[string]string
func (*LineParser) Split ¶
func (p *LineParser) Split(output string) []string
type Multipath ¶
type Multipath struct {
// reload or reject
Action string
Wwn string
DmDeviceName string
Vendor string
Product string
Size float64
Features string
HWHandler string
WritePermission string
Paths []SinglePath
// contains filtered or unexported fields
}
(Multipath) Subclass of Interface Each Multipath contains one or more SinglePath
func FindMultipath ¶
func NewMultipath ¶
func NewMultipath() []Multipath
func (*Multipath) GetCommand ¶
func (*Multipath) GetPattern ¶
func (s *Multipath) GetPattern() interface{}
type PairParser ¶
func (*PairParser) Parse ¶
func (f *PairParser) Parse(output string, pat interface{}) []map[string]string
func (*PairParser) Split ¶
func (f *PairParser) Split(output string) []string
type SinglePath ¶
type SinglePath struct {
//Policy string
//Priority string
Host int
Channel int
Id int
Lun int
DevNode string
Major int
Minor int
// possible value: failed, active
DmStatus string
// possible value: ready, ghost, faulty, shaky
PathStatus string
// possible value: running, offline
OnlineStatus string
// contains filtered or unexported fields
}
(SinglePath) Subclass of Interface
func NewSinglePath ¶
func NewSinglePath(output string) []SinglePath
func (*SinglePath) GetCommand ¶
func (single *SinglePath) GetCommand() []string
func (*SinglePath) GetPattern ¶
func (single *SinglePath) GetPattern() interface{}
func (*SinglePath) GetValue ¶
func (single *SinglePath) GetValue(key string) interface{}
func (*SinglePath) Parse ¶
func (single *SinglePath) Parse() []SinglePath
func (*SinglePath) SetOutput ¶
func (single *SinglePath) SetOutput(output string)