info

package
v1.3.3 Latest Latest
Warning

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

Go to latest
Published: Dec 14, 2025 License: MIT Imports: 5 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 LoadFromFS

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

Types

type Bitreg

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

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

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

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

func (*Control) GetName

func (c *Control) GetName() string

func (*Control) GetVersion

func (c *Control) GetVersion() string

func (*Control) SaveControl

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

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

type FS

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

FS secOrder quiser permitir override por FS externo:

type IPC

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

type KV

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

type KVValue

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

type KeyHash

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

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