Documentation
¶
Index ¶
- type Configuration
- func (c Configuration) AddNode(name string, nodeURL string) error
- func (c Configuration) CheckLogin(nodeName string, username string, password string) *odm.InfoResponse
- func (c Configuration) GetNode(name string) (*odm.Node, error)
- func (c Configuration) RemoveNode(name string) bool
- func (c Configuration) Save()
- func (c Configuration) UpdateNode(name string, node odm.Node)
- type PublicNode
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Configuration ¶
type Configuration struct { Nodes map[string]odm.Node `json:"nodes"` // contains filtered or unexported fields }
Configuration is a collection of config values
func NewConfiguration ¶
func NewConfiguration(filePath string) Configuration
NewConfiguration creates a new configuration from a specified file path
func (Configuration) AddNode ¶
func (c Configuration) AddNode(name string, nodeURL string) error
AddNode adds a new node to the configuration
func (Configuration) CheckLogin ¶ added in v1.1.0
func (c Configuration) CheckLogin(nodeName string, username string, password string) *odm.InfoResponse
CheckLogin checks if the node needs login if it does, it attempts to login it it doesn't, returns node.Info() on error, it prints a message and exits
func (Configuration) GetNode ¶
func (c Configuration) GetNode(name string) (*odm.Node, error)
GetNode gets a Node instance given its name
func (Configuration) RemoveNode ¶
func (c Configuration) RemoveNode(name string) bool
RemoveNode removes a node from the configuration
func (Configuration) UpdateNode ¶
func (c Configuration) UpdateNode(name string, node odm.Node)
type PublicNode ¶
type PublicNode struct { Url string `json:"url"` Maintainer string `json:"maintainer"` Company string `json:"company"` Website string `json:"website"` }
func GetPublicNodes ¶
func GetPublicNodes() []PublicNode
func (PublicNode) String ¶
func (n PublicNode) String() string
Click to show internal directories.
Click to hide internal directories.