Documentation ¶
Index ¶
- func DaemonInfoExists(ctx context.Context, file string) (bool, error)
- func DaemonInfoFile(name string, port int) string
- func DaemonPortForName(ctx context.Context, context string) (int, error)
- func DeleteDaemonInfo(ctx context.Context, file string) error
- func DeleteFromUserCache(ctx context.Context, file string) error
- func DeleteIngressesFromUserCache(ctx context.Context) error
- func ExistsInCache(ctx context.Context, fileName string) (bool, error)
- func KeepDaemonInfoAlive(ctx context.Context, file string) error
- func LoadFromUserCache(ctx context.Context, dest any, file string) error
- func LoadIngressesFromUserCache(ctx context.Context) (map[string]*manager.IngressInfo, error)
- func SaveDaemonInfo(ctx context.Context, object *DaemonInfo, file string) error
- func SaveIngressesToUserCache(ctx context.Context, ingresses map[string]*manager.IngressInfo) error
- func SaveToUserCache(ctx context.Context, object any, file string) error
- func WatchDaemonInfos(ctx context.Context, onChange func(context.Context) error, files ...string) error
- func WatchUserCache(ctx context.Context, subdir string, onChange func(context.Context) error, ...) error
- type DaemonInfo
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DaemonInfoExists ¶ added in v2.12.0
func DaemonInfoFile ¶ added in v2.12.0
func DaemonPortForName ¶ added in v2.12.0
func DeleteDaemonInfo ¶ added in v2.12.0
func DeleteIngressesFromUserCache ¶
DeleteIngressesFromUserCache removes the ingresses cache if exists or returns an error. An attempt to remove a non-existing cache is a no-op and the function returns nil.
func ExistsInCache ¶ added in v2.11.0
func KeepDaemonInfoAlive ¶ added in v2.12.0
KeepDaemonInfoAlive updates the access and modification times of the given DaemonInfo periodically so that it never gets older than keepAliveInterval. This means that any file with a modification time older than the current time minus two keepAliveIntervals can be considered stale and should be removed.
The alive poll ends and the DaemonInfo is deleted when the context is cancelled.
func LoadIngressesFromUserCache ¶
LoadIngressesFromUserCache gets the ingresses from cache. An empty map is returned if the file does not exist. An error is returned if something goes wrong while loading or unmarshalling.
func SaveDaemonInfo ¶ added in v2.12.0
func SaveDaemonInfo(ctx context.Context, object *DaemonInfo, file string) error
func SaveIngressesToUserCache ¶
SaveIngressesToUserCache saves the provided ingresses to user cache and returns an error if something goes wrong while marshalling or persisting.
func WatchDaemonInfos ¶ added in v2.12.0
Types ¶
type DaemonInfo ¶ added in v2.12.0
type DaemonInfo struct { Options map[string]string `json:"options,omitempty"` InDocker bool `json:"in_docker,omitempty"` KubeContext string `json:"kube_context,omitempty"` DaemonPort int `json:"daemon_port,omitempty"` }
func LoadDaemonInfo ¶ added in v2.12.0
func LoadDaemonInfo(ctx context.Context, file string) (*DaemonInfo, error)
func LoadDaemonInfos ¶ added in v2.12.0
func LoadDaemonInfos(ctx context.Context) ([]*DaemonInfo, error)