register

package
v3.2.1+incompatible Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 21, 2020 License: Apache-2.0 Imports: 18 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AddAllRequiredSvcs

func AddAllRequiredSvcs(nodeCreds, org, url, arch, versionRange string, allRequiredSvcs map[string]*SvcMapValue)

AddAllRequiredSvcs

func CreateInputFile

func CreateInputFile(nodeOrg, pattern, arch, nodeIdTok, inputFile string)

CreateInputFile runs thru the services used by this pattern (descending into all required services) and collects the user input needed

func DoIt

func DoIt(org, pattern, nodeIdTok, userPw, email, inputFile string, nodeOrgFromFlag string, patternFromFlag string, nodeName string, nodepolicyFlag string)

DoIt registers this node to Horizon with a pattern

func GetHighestService

func GetHighestService(nodeCreds, org, url, arch string, versionRanges []string) exchange.ServiceDefinition

GetHighestService queries the exchange for all versions of this service and returns the highest version that is within at least 1 of the version ranges

func ReadAndVerifyPolicFile

func ReadAndVerifyPolicFile(jsonFilePath string, nodePol *externalpolicy.ExternalPolicy)

read and verify a node policy file

func ReadInputFile

func ReadInputFile(filePath string, inputFileStruct *InputFile)

Types

type ExchangeNodes

type ExchangeNodes struct {
	LastIndex int                        `json:"lastIndex"`
	Nodes     map[string]exchange.Device `json:"nodes"`
}

type GlobalSet

type GlobalSet struct {
	Type         string                   `json:"type"`
	ServiceSpecs persistence.ServiceSpecs `json:"service_specs,omitempty"`
	Variables    map[string]interface{}   `json:"variables"`
}

These structs are used to parse the registration input file. These are also used by the hzn dev code.

func (GlobalSet) String

func (g GlobalSet) String() string

type InputFile

type InputFile struct {
	Global   []GlobalSet `json:"global,omitempty"`
	Services []MicroWork `json:"services,omitempty"`
}

type MicroWork

type MicroWork struct {
	Org          string                 `json:"org"`
	Url          string                 `json:"url"`
	VersionRange string                 `json:"versionRange,omitempty"` //optional
	Variables    map[string]interface{} `json:"variables"`
}

Use for services. This is used by other cli sub-cmds too.

func (MicroWork) String

func (m MicroWork) String() string

type SvcMapValue

type SvcMapValue struct {
	Org            string
	URL            string
	Arch           string
	VersionRanges  []string // all the version ranges we find for this service as we descend thru the required services
	HighestVersion string   // filled in when we have to find the highest service to get its required services. Is valid at the end if len(VersionRanges)==1
	UserInputs     []exchange.UserInput
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL