cli

package
v0.0.0-...-6c5e6c9 Latest Latest
Warning

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

Go to latest
Published: Jun 22, 2026 License: Apache-2.0 Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var LinuxConfigFilePath = "/etc/tedge/plugins/tedge-container-plugin.toml"

Functions

func GetImageSource

func GetImageSource(v string) string

func GetTedgeConfig

func GetTedgeConfig(property string) (string, error)

Types

type Cli

type Cli struct {
	ConfigFile string
}

func (*Cli) DeleteFromCloud

func (c *Cli) DeleteFromCloud() bool

func (*Cli) DeleteLegacyService

func (c *Cli) DeleteLegacyService() bool

func (*Cli) DeleteOrphans

func (c *Cli) DeleteOrphans() bool

func (*Cli) EngineEventsEnabled

func (c *Cli) EngineEventsEnabled() bool

func (*Cli) GetBool

func (c *Cli) GetBool(key string) bool

func (*Cli) GetCAFile

func (c *Cli) GetCAFile() string

func (*Cli) GetCertificateFile

func (c *Cli) GetCertificateFile() string

func (*Cli) GetContainerClientOptions

func (c *Cli) GetContainerClientOptions() []container.Opt

func (*Cli) GetContainerHost

func (c *Cli) GetContainerHost() string

GetContainerHost get the container engine's host configuration (if manually defined by the user)

func (*Cli) GetContainerRepositoryCredentialsFunc

func (c *Cli) GetContainerRepositoryCredentialsFunc(imageRef string) func(ctx context.Context, attempt int) (string, error)

func (*Cli) GetCrashLoopThreshold

func (c *Cli) GetCrashLoopThreshold() int

func (*Cli) GetCredentialsFromScript

func (c *Cli) GetCredentialsFromScript(ctx context.Context, script string, args ...string) (RepositoryAuth, error)

func (*Cli) GetCumulocityHost

func (c *Cli) GetCumulocityHost() string

func (*Cli) GetCumulocityPort

func (c *Cli) GetCumulocityPort() uint16

func (*Cli) GetDeviceID

func (c *Cli) GetDeviceID() string

func (*Cli) GetDeviceTarget

func (c *Cli) GetDeviceTarget() tedge.Target

func (*Cli) GetFilterOptions

func (c *Cli) GetFilterOptions() container.FilterOptions

func (*Cli) GetHTTPHost

func (c *Cli) GetHTTPHost() string

func (*Cli) GetHTTPPort

func (c *Cli) GetHTTPPort() uint16

func (*Cli) GetKeyFile

func (c *Cli) GetKeyFile() string

func (*Cli) GetMQTTHost

func (c *Cli) GetMQTTHost() string

func (*Cli) GetMQTTPort

func (c *Cli) GetMQTTPort() uint16

func (*Cli) GetMetricsInterval

func (c *Cli) GetMetricsInterval() time.Duration

func (*Cli) GetOrphansCheckInterval

func (c *Cli) GetOrphansCheckInterval() time.Duration

GetOrphansCheckInterval returns the minimum time between routine checks for orphaned cloud services. The check costs additional Cumulocity REST calls on each update, so it is rate limited (the interval is bypassed when an update removed stale services, when new orphans are likely). A value of 0 (or less) checks on every update.

func (*Cli) GetReconcileInterval

func (c *Cli) GetReconcileInterval() time.Duration

GetReconcileInterval returns how often the full container state should be reconciled with thin-edge.io and the cloud, independently of container engine events or MQTT messages. The reconcile loop is a safety net which retries pending cloud deletions and removes stale/orphaned services even when the event that should have triggered the cleanup was lost (e.g. the bridge-online message was missed due to retained message loss). A value of 0 (or less) disables the reconcile loop.

func (*Cli) GetRegistryCredentials

func (c *Cli) GetRegistryCredentials(url string) RepositoryAuth

func (*Cli) GetRegistryCredentialsPath

func (c *Cli) GetRegistryCredentialsPath() string

func (*Cli) GetServiceName

func (c *Cli) GetServiceName() string

func (*Cli) GetSharedContainerNetwork

func (c *Cli) GetSharedContainerNetwork() string

func (*Cli) GetString

func (c *Cli) GetString(key string) string

func (*Cli) GetSyncRetryInterval

func (c *Cli) GetSyncRetryInterval() time.Duration

GetSyncRetryInterval returns the delay before a failed cloud sync is retried, e.g. a pending cloud service deletion which failed because the local Cumulocity proxy was unavailable. The retry is scheduled by the plugin itself so pending operations recover even when no container engine event or bridge health message arrives to trigger an update. A value of 0 (or less) disables the failure-driven retry.

func (*Cli) GetTopicID

func (c *Cli) GetTopicID() string

func (*Cli) GetTopicRoot

func (c *Cli) GetTopicRoot() string

func (*Cli) ImageAlwaysPull

func (c *Cli) ImageAlwaysPull() bool

func (*Cli) MetricsEnabled

func (c *Cli) MetricsEnabled() bool

func (*Cli) OnInit

func (c *Cli) OnInit()

func (*Cli) PersistentDir

func (c *Cli) PersistentDir(check_writable bool) (string, error)

func (*Cli) PrintConfig

func (c *Cli) PrintConfig()

func (*Cli) UseModuleNameForService

func (c *Cli) UseModuleNameForService() bool

type ExitCodeError

type ExitCodeError struct {
	Err    error
	Code   int
	Silent bool
}

func NewExitCodeError

func NewExitCodeError(err error) *ExitCodeError

func (ExitCodeError) Error

func (e ExitCodeError) Error() string

func (ExitCodeError) ExitCode

func (e ExitCodeError) ExitCode() int

type RepositoryAuth

type RepositoryAuth struct {
	URL      string
	Username string `json:"username"`
	Password string `json:"password"`
}

func (*RepositoryAuth) IsSet

func (a *RepositoryAuth) IsSet() bool

Jump to

Keyboard shortcuts

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