capabilities

package
v0.0.0-...-3f873ad Latest Latest
Warning

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

Go to latest
Published: Dec 10, 2024 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Overview

Package capabilities maintain global capabilities

Scan() use registered scanners functions to update capabilities list, then store this capabilities list on filesystem.

Has(cap) use capabilities file to verify if cap exists

A global list of registered scanner functions may be Registered to scanner list. Registered scanners are called to refresh capabilities during Scan()

Index

Constants

This section is empty.

Variables

View Source
var (
	// ErrorNeedScan error mean capabilities needs scan
	ErrorNeedScan = errors.New("capabilities not yet scanned")
)

Functions

func Has

func Has(cap string) bool

Has return true if capability cap exists

func Register

func Register(s scanner)

Register add new s scanner function to scanners list

func Scan

func Scan() error

Scan refresh capabilities from the scanners function calls, then it update capabilities list stored on file system

func SetCacheFile

func SetCacheFile(s string)

Types

type L

type L []string

L is a list of capabilities expressed as strings

func Data

func Data() L

Data return copy of capabilities

func Load

func Load() (loadedCaps L, err error)

Load fetch existing capabilities from its backend file

func (L) Render

func (t L) Render() string

Render is a human rendered for node capabilities

Jump to

Keyboard shortcuts

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