info

package
v1.6.8 Latest Latest
Warning

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

Go to latest
Published: Dec 21, 2025 License: MIT Imports: 7 Imported by: 0

Documentation

Overview

Package info provides functionality to read and parse the application manifest.

Package info gerencia controle e configuração modular, com suporte a arquivos separados por módulo.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetDescriptions added in v1.5.6

func GetDescriptions(descriptionArg []string, hideBanner bool) map[string]string

func LoadFromFS added in v1.5.6

func LoadFromFS(fs FS) (Manifest, Control, error)

Types

type Bitreg added in v1.5.6

type Bitreg struct {
	BrfPath string `json:"brf_path"`
	NSBits  int    `json:"ns_bits"`
	Policy  string `json:"policy,omitempty"`

	// CapMask is a hexadecimal string representing the capability mask.
	CapMask string `json:"cap_mask,omitempty"`

	// StateHex is a hexadecimal string representing the state.
	StateHex string `json:"state_hex,omitempty"`
}

type Control added in v1.5.6

type Control struct {
	Reference     Reference `json:"-"` // Usado internamente para nome do arquivo, nunca exportado
	SchemaVersion int       `json:"schema_version"`
	IPC           IPC       `json:"ipc"`
	Bitreg        Bitreg    `json:"bitreg"`
	KV            KV        `json:"kv"`
	Seq           int       `json:"seq"`
	EpochNS       int64     `json:"epoch_ns"`
}

Control representa a configuração de controle de um módulo.

func LoadControlByModule added in v1.5.6

func LoadControlByModule(dir string, moduleName string) (*Control, error)

LoadControlByModule carrega o controle de um arquivo específico do módulo.

func (*Control) GetName added in v1.5.6

func (c *Control) GetName() string

func (*Control) GetVersion added in v1.5.6

func (c *Control) GetVersion() string

func (*Control) SaveControl added in v1.5.6

func (c *Control) SaveControl(dir string) error

SaveControl salva o controle do módulo em arquivo separado.

type FS added in v1.5.6

type FS interface {
	ReadFile(name string) ([]byte, error)
}

FS secOrder quiser permitir override por FS externo:

type IPC added in v1.5.6

type IPC struct {
	Type   string `json:"type"`
	Socket string `json:"socket"`
	Mode   string `json:"mode,omitempty"`
}

type KV added in v1.5.6

type KV struct {
	DeclareHashes []KeyHash `json:"declare_hashes,omitempty"`
	Values        []KVValue `json:"values,omitempty"`
	Encoding      string    `json:"encoding,omitempty"`
}

type KVValue added in v1.5.6

type KVValue struct {
	KeyHash string `json:"key_hash"`
	U64Hex  string `json:"u64_hex,omitempty"`
}

type KeyHash added in v1.5.6

type KeyHash struct {
	KeyHash string `json:"key_hash"`
}

type Manifest

type Manifest interface {
	GetName() string
	GetVersion() string
	GetAliases() []string
	GetRepository() string
	GetHomepage() string
	GetDescription() string
	GetMain() string
	GetBin() string
	GetAuthor() string
	GetLicense() string
	GetKeywords() []string
	GetPlatforms() []string
	IsPrivate() bool
}

func GetManifest

func GetManifest() (Manifest, error)

GetManifest lazy, sem init() com side-effects

type Reference added in v1.5.6

type Reference struct {
	Name            string `json:"name"`
	ApplicationName string `json:"application"`
	Bin             string `json:"bin"`
	Version         string `json:"version"`
}

Jump to

Keyboard shortcuts

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