Versions in this module Expand all Collapse all v2 v2.2.0 Sep 17, 2026 Changes in this version + const KindDataRepository + const KindField + const KindFirmware + const KindGateway + const KindNode + const KindPolicy + const KindServiceAccount + const KindSource + const KindUser + const OperationAdd + const OperationDelete + const OperationMerge + var ErrApplyFailed = errors.New("apply failed") + func Apply(client ResourceClient, resources []Resource, replace, dryRun bool, ...) error + type Resource struct + DataRepository *dataRepoTY.Config + Field *fieldTY.Field + Firmware *firmwareTY.Firmware + Gateway *gwTY.Config + Index int + Kind string + Node *nodeTY.Node + Operation string + Payload map[string]interface{} + Policy *policyTY.Policy + Replace bool + ServiceAccount *svcAccountTY.ServiceAccount + Source string + Src *sourceTY.Source + User *userTY.User + func ParseResources(data []byte, source string) ([]Resource, error) + func (r Resource) ID() string + func (r Resource) Identity() string + func (r Resource) NaturalKeys() (gatewayID, nodeID, sourceID, fieldID string) + func (r Resource) SetID(id string) + func (r Resource) TableResource() string + func (r Resource) Validate() error + type ResourceClient interface + DeleteDataRepository func(ids ...string) error + DeleteField func(ids ...string) error + DeleteFirmware func(ids ...string) error + DeleteGateway func(ids ...string) error + DeleteNode func(ids ...string) error + DeletePolicy func(ids ...string) error + DeleteServiceAccount func(ids ...string) error + DeleteSource func(ids ...string) error + DeleteUser func(ids ...string) error + FindDataRepository func(id string) (idFound string, err error) + FindField func(id, gatewayID, nodeID, sourceID, fieldID string) (idFound string, err error) + FindFirmware func(id string) (idFound string, err error) + FindGateway func(id string) (idFound string, err error) + FindNode func(id, gatewayID, nodeID string) (idFound string, err error) + FindPolicy func(id string) (idFound string, err error) + FindServiceAccount func(id, name, userRef string) (idFound string, err error) + FindSource func(id, gatewayID, nodeID, sourceID string) (idFound string, err error) + FindUser func(id, username string) (idFound string, err error) + GetExisting func(resource Resource) ([]byte, error) + SaveDataRepository func(resource Resource) error + SaveField func(resource Resource) error + SaveFirmware func(resource Resource) error + SaveGateway func(resource Resource) error + SaveNode func(resource Resource) error + SavePolicy func(resource Resource) error + SaveServiceAccount func(resource Resource) (token string, err error) + SaveSource func(resource Resource) error + SaveUser func(resource Resource) error