Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ContextObjectPath = Context{ Key: "path", Attr: "Path", Ref: "object.path", } ContextEncapNodes = Context{ Key: "encapnodes", Attr: "EncapNodes", Ref: "object.encapnodes", } ContextDRPNodes = Context{ Key: "drpnodes", Attr: "DRPNodes", Ref: "object.drpnodes", } ContextNodes = Context{ Key: "nodes", Attr: "Nodes", Ref: "object.nodes", } ContextObjectFQDN = Context{ Key: "object_fqdn", Attr: "ObjectFQDN", Ref: "object.fqdn", } ContextObjectDomain = Context{ Key: "object_domain", Attr: "ObjectDomain", Ref: "object.domain", } ContextObjectID = Context{ Key: "objectID", Attr: "ObjectID", Ref: "object.id", } ContextDNS = Context{ Key: "dns", Attr: "DNS", Ref: "node.dns", } ContextPeers = Context{ Key: "peers", Attr: "Peers", Ref: "object.peers", } ContextTopology = Context{ Key: "topology", Attr: "Topology", Ref: "object.topology", } ContextCNIPlugins = Context{ Key: "cni_plugins", Attr: "CNIPlugins", Ref: "cni.plugins", } ContextCNIConfig = Context{ Key: "cni_config", Attr: "CNIConfig", Ref: "cni.config", } )
View Source
var ( KWBlockingPostProvision = keywords.Keyword{ Attr: "BlockingPostProvision", Option: "blocking_post_provision", Scopable: true, Text: keywords.NewText(fs, "text/kw/blocking_post_provision"), } KWBlockingPostRun = keywords.Keyword{ Attr: "BlockingPostRun", Option: "blocking_post_run", Scopable: true, Text: keywords.NewText(fs, "text/kw/blocking_post_run"), } KWBlockingPostStart = keywords.Keyword{ Attr: "BlockingPostStart", Option: "blocking_post_start", Scopable: true, Text: keywords.NewText(fs, "text/kw/blocking_post_start"), } KWBlockingPostStop = keywords.Keyword{ Attr: "BlockingPostStop", Option: "blocking_post_stop", Scopable: true, Text: keywords.NewText(fs, "text/kw/blocking_post_stop"), } KWBlockingPostUnprovision = keywords.Keyword{ Attr: "BlockingPostUnprovision", Option: "blocking_post_unprovision", Scopable: true, Text: keywords.NewText(fs, "text/kw/blocking_post_unprovision"), } KWBlockingPreProvision = keywords.Keyword{ Attr: "BlockingPreProvision", Option: "blocking_pre_provision", Scopable: true, Text: keywords.NewText(fs, "text/kw/blocking_pre_provision"), } KWBlockingPreRun = keywords.Keyword{ Attr: "BlockingPreRun", Option: "blocking_pre_run", Scopable: true, Text: keywords.NewText(fs, "text/kw/blocking_pre_run"), } KWBlockingPreStart = keywords.Keyword{ Attr: "BlockingPreStart", Option: "blocking_pre_start", Scopable: true, Text: keywords.NewText(fs, "text/kw/blocking_pre_start"), } KWBlockingPreStop = keywords.Keyword{ Attr: "BlockingPreStop", Option: "blocking_pre_stop", Scopable: true, Text: keywords.NewText(fs, "text/kw/blocking_pre_stop"), } KWBlockingPreUnprovision = keywords.Keyword{ Attr: "BlockingPreUnprovision", Option: "blocking_pre_unprovision", Scopable: true, Text: keywords.NewText(fs, "text/kw/blocking_pre_unprovision"), } KWDisable = keywords.Keyword{ Attr: "Disable", Converter: converters.Bool, Option: "disable", Scopable: true, Text: keywords.NewText(fs, "text/kw/disable"), } KWEnableProvision = keywords.Keyword{ Attr: "EnableProvision", Converter: converters.Bool, Default: "true", Option: "provision", Text: keywords.NewText(fs, "text/kw/provision"), } KWEnableUnprovision = keywords.Keyword{ Attr: "EnableUnprovision", Converter: converters.Bool, Default: "true", Option: "unprovision", Text: keywords.NewText(fs, "text/kw/unprovision"), } KWEncap = keywords.Keyword{ Attr: "Encap", Converter: converters.Bool, Option: "encap", Text: keywords.NewText(fs, "text/kw/encap"), } KWMonitor = keywords.Keyword{ Attr: "Monitor", Converter: converters.Bool, Option: "monitor", Scopable: true, Text: keywords.NewText(fs, "text/kw/monitor"), } KWOptional = keywords.Keyword{ Attr: "Optional", Converter: converters.Bool, Inherit: keywords.InheritHead2Leaf, Option: "optional", Scopable: true, Text: keywords.NewText(fs, "text/kw/optional"), } KWPostProvision = keywords.Keyword{ Attr: "PostProvision", Option: "post_provision", Scopable: true, Text: keywords.NewText(fs, "text/kw/post_provision"), } KWPostRun = keywords.Keyword{ Attr: "PostRun", Option: "post_run", Scopable: true, Text: keywords.NewText(fs, "text/kw/post_provision"), } KWPostStart = keywords.Keyword{ Attr: "PostStart", Option: "post_start", Scopable: true, Text: keywords.NewText(fs, "text/kw/post_provision"), } KWPostStop = keywords.Keyword{ Attr: "PostStop", Option: "post_stop", Scopable: true, Text: keywords.NewText(fs, "text/kw/post_provision"), } KWPostUnprovision = keywords.Keyword{ Attr: "PostUnprovision", Option: "post_unprovision", Scopable: true, Text: keywords.NewText(fs, "text/kw/post_provision"), } KWPreProvision = keywords.Keyword{ Attr: "PreProvision", Option: "pre_provision", Scopable: true, Text: keywords.NewText(fs, "text/kw/post_provision"), } KWPreRun = keywords.Keyword{ Attr: "PreRun", Option: "pre_run", Scopable: true, Text: keywords.NewText(fs, "text/kw/post_provision"), } KWPreStart = keywords.Keyword{ Attr: "PreStart", Option: "pre_start", Scopable: true, Text: keywords.NewText(fs, "text/kw/post_provision"), } KWPreStop = keywords.Keyword{ Attr: "PreStop", Option: "pre_stop", Scopable: true, Text: keywords.NewText(fs, "text/kw/post_provision"), } KWPreUnprovision = keywords.Keyword{ Attr: "PreUnprovision", Option: "pre_unprovision", Scopable: true, Text: keywords.NewText(fs, "text/kw/post_provision"), } KWProvisionRequires = keywords.Keyword{ Attr: "ProvisionRequires", Example: "ip#0 fs#0(down,stdby down)", Option: "provision_requires", Text: keywords.NewText(fs, "text/kw/provision_requires"), } KWRestart = keywords.Keyword{ Attr: "Restart", Default: "0", Converter: converters.Int, Option: "restart", Scopable: true, Text: keywords.NewText(fs, "text/kw/restart"), } KWRestartDelay = keywords.Keyword{ Attr: "RestartDelay", Converter: converters.Duration, Default: "500ms", Option: "restart_delay", Scopable: true, Text: keywords.NewText(fs, "text/kw/post_provision"), } KWRunRequires = keywords.Keyword{ Attr: "RunRequires", Example: "ip#0 fs#0(down,stdby down)", Option: "run_requires", Text: keywords.NewText(fs, "text/kw/run_requires"), } KWSCSIPersistentReservationEnabled = keywords.Keyword{ Attr: "SCSIPersistentReservation.Enabled", Converter: converters.Bool, Option: "scsireserv", Text: keywords.NewText(fs, "text/kw/scsireserv"), } KWSCSIPersistentReservationKey = keywords.Keyword{ Attr: "SCSIPersistentReservation.Key", Option: "prkey", Scopable: true, Text: keywords.NewText(fs, "text/kw/prkey"), } KWSCSIPersistentReservationNoPreemptAbort = keywords.Keyword{ Attr: "SCSIPersistentReservation.NoPreemptAbort", Converter: converters.Bool, Option: "no_preempt_abort", Scopable: true, Text: keywords.NewText(fs, "text/kw/no_preempt_abort"), } Attr: "Shared", Converter: converters.Bool, Option: "shared", Scopable: true, Text: keywords.NewText(fs, "text/kw/shared"), } KWStandby = keywords.Keyword{ Attr: "Standby", Converter: converters.Bool, Option: "standby", Scopable: true, Text: keywords.NewText(fs, "text/kw/standby"), } KWStartRequires = keywords.Keyword{ Attr: "StartRequires", Example: "ip#0 fs#0(down,stdby down)", Option: "start_requires", Text: keywords.NewText(fs, "text/kw/start_requires"), } KWStopRequires = keywords.Keyword{ Attr: "StopRequires", Example: "ip#0 fs#0(down,stdby down)", Option: "stop_requires", Text: keywords.NewText(fs, "text/kw/stop_requires"), } KWSubset = keywords.Keyword{ Attr: "Subset", Option: "subset", Scopable: true, Text: keywords.NewText(fs, "text/kw/post_provision"), } KWSyncRequires = keywords.Keyword{ Attr: "SyncRequires", Example: "ip#0 fs#0(down,stdby down)", Option: "sync_requires", Text: keywords.NewText(fs, "text/kw/sync_requires"), } KWTags = keywords.Keyword{ Attr: "Tags", Converter: converters.Set, Option: "tags", Scopable: true, Text: keywords.NewText(fs, "text/kw/tags"), } KWUnprovisionRequires = keywords.Keyword{ Attr: "UnprovisionRequires", Example: "ip#0 fs#0(down,stdby down)", Option: "unprovision_requires", Text: keywords.NewText(fs, "text/kw/unprovision_requires"), } SCSIPersistentReservationKeywords = []keywords.Keyword{ KWSCSIPersistentReservationEnabled, KWSCSIPersistentReservationKey, KWSCSIPersistentReservationNoPreemptAbort, } )
Functions ¶
This section is empty.
Types ¶
type Context ¶
type Context struct { // Key is the name of the key in the json representation of the context. Key string // Attr is the name of the field in the resource struct. Attr string // Ref is the code describing what context information to embed in the resource struct. Ref string }
Context is a key-value the resource expects to find in the input, merged with keywords coming from configuration file.
For example, a driver often needs the parent object Path, which can be asked via:
T{ Context: []Context{ { Key: "path", Ref:"object.path", }, }, }
type T ¶
T describes a driver so callers can format the input as the driver expects.
A typical allocation is: m := New("fs", "flag").AddKeyword(kws...).AddContext(ctx...)
func New ¶
New returns *T with keywords defined
It adds generic keywords + keywords from interface keywords.
func (*T) AddInterfacesKeywords ¶
AddInterfacesKeywords adds keywords from interfaces and returns t
When interfaces contains both value and pointer receiver r should be a pointer
Click to show internal directories.
Click to hide internal directories.