Documentation ¶
Index ¶
- Constants
- Variables
- func CreateEntries(addresses []string, hostnqn string, nqn string, transport string) ([]*commonstructs.Entry, error)
- func CreateFile(filename string, entries []*commonstructs.Entry) error
- func DetectEntriesByIOControllers(nvmeCtrlPath string, discoveryServicePort uint) ([]*commonstructs.Entry, error)
- func EntriesToString(entries []*Entry) string
- func ShouldGenerateAutoDetectedEntries(clientConfigDir, internalDir string) bool
- func StoreEntries(filename string, entries []*commonstructs.Entry) error
- type Cache
- type ClientClusterPair
- type ClusterConnections
- type Connection
- type ConnectionMap
- type Entry
- type Event
- type EventOp
- type FileWatcher
- type ParserError
- type ReferralKey
- type ReferralMap
- type TKey
Constants ¶
View Source
const ( NVMF_DEF_DISC_TMO = 30 InternalJson = "internal.json" )
Variables ¶
View Source
var (
NvmeCtrlPath = filepath.Join("/sys/class/nvme", "nvme[0-9]")
)
Functions ¶
func CreateEntries ¶
func CreateFile ¶
func CreateFile(filename string, entries []*commonstructs.Entry) error
func DetectEntriesByIOControllers ¶
func DetectEntriesByIOControllers(nvmeCtrlPath string, discoveryServicePort uint) ([]*commonstructs.Entry, error)
func EntriesToString ¶
func ShouldGenerateAutoDetectedEntries ¶
ShouldGenerateAutoDetectedEntries - return true only in case client and internal dirs are empty
func StoreEntries ¶
func StoreEntries(filename string, entries []*commonstructs.Entry) error
Types ¶
type Cache ¶
type Cache interface { // Run start watching for changes Run(sync bool) error // Stop stop watching for changes Stop() // Clear clears the entries we have till now Clear() Connections() <-chan ConnectionMap HandleReferrals(referrals ReferralMap) error }
type ClientClusterPair ¶
type ClusterConnections ¶
type ClusterConnections struct { ClusterConnectionsMap map[TKey]*Connection ActiveConnection *Connection }
func (ClusterConnections) Exists ¶
func (cc ClusterConnections) Exists(c *Connection) bool
func (ClusterConnections) GetRandomConnectionList ¶
func (c ClusterConnections) GetRandomConnectionList() []*Connection
type Connection ¶
type Connection struct { Hostnqn string Key TKey Ctx context.Context AENChan chan hostapi.AENStruct ConnectionID hostapi.ConnectionID State bool // contains filtered or unexported fields }
func (*Connection) GetDiscoveryRequest ¶
func (c *Connection) GetDiscoveryRequest(kato time.Duration) *hostapi.DiscoverRequest
func (*Connection) SetState ¶
func (c *Connection) SetState(newState bool)
func (*Connection) Stop ¶
func (c *Connection) Stop()
func (*Connection) String ¶
func (c *Connection) String() string
type ConnectionMap ¶
type ConnectionMap map[ClientClusterPair]ClusterConnections
func (ConnectionMap) AddConnection ¶
func (cm ConnectionMap) AddConnection(key TKey, conn *Connection)
func (ConnectionMap) DeleteConnection ¶
func (cm ConnectionMap) DeleteConnection(clientClusterPair ClientClusterPair, key TKey)
type FileWatcher ¶
type FileWatcher struct {
// contains filtered or unexported fields
}
type ParserError ¶
func (*ParserError) Error ¶
func (e *ParserError) Error() string
func (*ParserError) Unwrap ¶
func (e *ParserError) Unwrap() error
type ReferralKey ¶
type ReferralKey struct { Ip string Port uint16 DPSubNqn string // Datapath subsystem nqn. The referral log page entry does not contain it but we need it to create a new connection based on the referral Hostnqn string // The referral log page entry does not contain it but we need it to create a new connection based on the referral }
type ReferralMap ¶
type ReferralMap map[ReferralKey]*hostapi.NvmeDiscPageEntry
Click to show internal directories.
Click to hide internal directories.