specs

package
v0.2.8 Latest Latest
Warning

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

Go to latest
Published: Sep 4, 2024 License: GPL-3.0 Imports: 5 Imported by: 0

Documentation

Overview

Copyright © 2024 Macaroni OS Linux See AUTHORS and LICENSE for the license details and contributors.

Copyright © 2024 Macaroni OS Linux See AUTHORS and LICENSE for the license details and contributors.

Copyright © 2024 Macaroni OS Linux See AUTHORS and LICENSE for the license details and contributors.

Copyright © 2024 Macaroni OS Linux See AUTHORS and LICENSE for the license details and contributors.

Copyright © 2024 Macaroni OS Linux See AUTHORS and LICENSE for the license details and contributors.

Copyright © 2024 Macaroni OS Linux See AUTHORS and LICENSE for the license details and contributors.

Copyright © 2024 Macaroni OS Linux See AUTHORS and LICENSE for the license details and contributors.

Copyright © 2024 Macaroni OS Linux See AUTHORS and LICENSE for the license details and contributors.

Index

Constants

View Source
const (
	GPUCONF_ENV_PREFIX = "GPUCONF"
	GPUCONF_VERSION    = "0.2.8"
)

Variables

This section is empty.

Functions

func GenDefault

func GenDefault(viper *v.Viper)

Types

type CGeneral

type CGeneral struct {
	Debug   bool   `mapstructure:"debug,omitempty" json:"debug,omitempty" yaml:"debug,omitempty"`
	Backend string `mapstructure:"backend,omitempty" json:"backend,omitempty" yaml:"backend,omitempty"`
}

func (*CGeneral) GetBackendType

func (g *CGeneral) GetBackendType() string

func (*CGeneral) HasDebug

func (g *CGeneral) HasDebug() bool

type CLogging

type CLogging struct {
	// Path of the logfile
	Path string `mapstructure:"path,omitempty" json:"path,omitempty" yaml:"path,omitempty"`
	// Enable/Disable logging to file
	EnableLogFile bool `mapstructure:"enable_logfile,omitempty" json:"enable_logfile,omitempty" yaml:"enable_logfile,omitempty"`
	// Enable JSON format logging in file
	JsonFormat bool `mapstructure:"json_format,omitempty" json:"json_format,omitempty" yaml:"json_format,omitempty"`

	// Log level
	Level string `mapstructure:"level,omitempty" json:"level,omitempty" yaml:"level,omitempty"`

	// Enable emoji
	EnableEmoji bool `mapstructure:"enable_emoji,omitempty" json:"enable_emoji,omitempty" yaml:"enable_emoji,omitempty"`
	// Enable/Disable color in logging
	Color bool `mapstructure:"color,omitempty" json:"color,omitempty" yaml:"color,omitempty"`
}

type CNvidia added in v0.2.0

type CNvidia struct {
	// Enable/Disable GBM library/Backend
	EnableGbmlib bool `mapstructure:"enable_gbmlib,omitempty" json:"enable_gbmlib,omitempty" yaml:"enable_gbmlib,omitempty"`
}

type Config

type Config struct {
	Viper *v.Viper `yaml:"-" json:"-"`

	General CGeneral `mapstructure:"general" json:"general,omitempty" yaml:"general,omitempty"`
	Logging CLogging `mapstructure:"logging" json:"logging,omitempty" yaml:"logging,omitempty"`
	Nvidia  CNvidia  `mapstructure:"nvidia,omitempty" json:"nvidia,omitempty" yaml:"nvidia,omitempty"`
}

func NewConfig

func NewConfig(viper *v.Viper) *Config

func (*Config) GetGeneral

func (c *Config) GetGeneral() *CGeneral

func (*Config) GetLogging

func (c *Config) GetLogging() *CLogging

func (*Config) GetNvidia added in v0.2.0

func (c *Config) GetNvidia() *CNvidia

func (*Config) Json

func (c *Config) Json() ([]byte, error)

func (*Config) Unmarshal

func (c *Config) Unmarshal() error

func (*Config) Yaml

func (c *Config) Yaml() ([]byte, error)

type EglExternalPlatformFiles

type EglExternalPlatformFiles struct {
	Path  string               `json:"path" yaml:"path"`
	Files map[string]*JsonFile `json:"files,omitempty" yaml:"files,omitempty"`
}

func NewEglExternalPlatformFiles

func NewEglExternalPlatformFiles(dir string) *EglExternalPlatformFiles

func (*EglExternalPlatformFiles) AddFile

func (e *EglExternalPlatformFiles) AddFile(file string, jsonfile *JsonFile)

type ICDJson

type ICDJson struct {
	FileFormatVersion string      `json:"file_format_version" yaml:"file_format_version"`
	ICD               ICDJsonData `json:"ICD" yaml:"ICD"`
}

func NewICDJson

func NewICDJson(data []byte) (*ICDJson, error)

type ICDJsonData

type ICDJsonData struct {
	LibraryPath string `json:"library_path" yaml:"library_path"`
	ApiVersion  string `json:"api_version,omitempty" yaml:"api_version,omitempty"`
}

type JsonFile

type JsonFile struct {
	Name     string   `json:"name" yaml:"name"`
	Disabled bool     `json:"disabled,omitempty" yaml:"disabled,omitempty"`
	File     *ICDJson `json:"file,omitempty" yaml:"file,omitempty"`
}

func NewJsonFile

func NewJsonFile(n string, f *ICDJson) *JsonFile

type KernelModule

type KernelModule struct {
	Path          string            `json:"path,omitempty" yaml:"path,omitempty"`
	KernelVersion string            `json:"kernel_version,omitempty" yaml:"kernel_version,omitempty"`
	Fields        map[string]string `json:"fields,omitempty" yaml:"fields,omitempty"`
	Name          string            `json:"name,omitempty" yaml:"name,omitempty"`
}

func (*KernelModule) GetFieldLicense added in v0.2.0

func (km *KernelModule) GetFieldLicense() string

func (*KernelModule) GetFieldVersion

func (km *KernelModule) GetFieldVersion() string

func (*KernelModule) IsOpen added in v0.2.0

func (km *KernelModule) IsOpen() bool

func (*KernelModule) Yaml added in v0.2.0

func (km *KernelModule) Yaml() ([]byte, error)

type Library

type Library struct {
	Name       string `json:"library" yaml:"library"`
	Disabled   bool   `json:"disabled,omitempty" yaml:"disabled,omitempty"`
	Broken     bool   `json:"broken,omitempty" yaml:"broken,omitempty"`
	LinkedFile string `json:"linked_libpath,omitempty" yaml:"linked_libpath,omitempty'`
}

type NVIDIADriver

type NVIDIADriver struct {
	Path              string `json:"path" yaml:"path"`
	Version           string `json:"version" yaml:"version"`
	WithKernelModules bool   `json:"with_kernel_modules,omitempty" yaml:"with_kernel_modules,omitempty"`
}

type NVIDIASetup

type NVIDIASetup struct {
	Drivers              []*NVIDIADriver `json:"drivers,omitempty" yaml:"drivers,omitempty"`
	VersionActive        string          `json:"version_active,omitempty" yaml:"version_active,omitempty"`
	KModuleAvailable     []*KernelModule `json:"kernel_modules,omitempty" yaml:"kernel_modules,omitempty"`
	KModuleActive        []*KernelModule `json:"kernel_modules_active,omitempty" yaml:"kernel_modules_active,omitempty"`
	KOpenModuleAvailable []*KernelModule `json:"kernel_open_modules,omitempty" yaml:"kernel_open_modules,omitempty"`
	KOpenModuleActive    []*KernelModule `json:"kernel_open_modules_active,omitempty" yaml:"kernel_open_modules_active,omitempty"`
}

func NewNVIDIASetup

func NewNVIDIASetup() *NVIDIASetup

func (*NVIDIASetup) GetDriver

func (n *NVIDIASetup) GetDriver(v string) *NVIDIADriver

func (*NVIDIASetup) GetKernelModulesActive added in v0.2.0

func (n *NVIDIASetup) GetKernelModulesActive(nv, kv string) *KernelModule

func (*NVIDIASetup) GetKernelModulesAvailable added in v0.2.0

func (n *NVIDIASetup) GetKernelModulesAvailable(nv string, open bool) *[]*KernelModule

func (*NVIDIASetup) HasVersion

func (n *NVIDIASetup) HasVersion(v string) bool

func (*NVIDIASetup) SetVersion added in v0.2.0

func (n *NVIDIASetup) SetVersion(v string)

type System

type System struct {
	EglExtPlatformDirs []*EglExternalPlatformFiles `json:"egl_external_platforms_dirs,omitempty" yaml:"egl_external_platforms_dirs,omitempty"`
	VulkanLayersDirs   []*VulkanLayersFiles        `json:"vulkan_layers_dirs,omitempty" yaml:"vulkan_layers_dirs,omitempty"`
	VulkanICDDirs      []*EglExternalPlatformFiles `json:"vulkan_icd_dirs,omitempty" yaml:"vulkan_icd_dirs,omitempty"`

	GbmLibraries []*Library `json:"gbm_libs,omitempty" yaml:"gbm_libs,omitempty"`

	Nvidia *NVIDIASetup `json:"nvidia,omitempty" yaml:"nvidia,omitempty"`
}

func NewSystem

func NewSystem() *System

func (*System) GetEglLoader

func (s *System) GetEglLoader(jsonfile string) (*EglExternalPlatformFiles, *JsonFile)

func (*System) GetGBMLibrary

func (s *System) GetGBMLibrary(lib string) *Library

func (*System) GetNvidia added in v0.2.0

func (s *System) GetNvidia() *NVIDIASetup

func (*System) GetVulkanIcdFile

func (s *System) GetVulkanIcdFile(jsonfile string) (*EglExternalPlatformFiles, *JsonFile)

func (*System) GetVulkanLayerFile

func (s *System) GetVulkanLayerFile(jsonfile string) (*VulkanLayersFiles, *VulkanLayersFile)

func (*System) Json

func (s *System) Json() ([]byte, error)

func (*System) Yaml

func (s *System) Yaml() ([]byte, error)

type VulkanLayersFile

type VulkanLayersFile struct {
	Name     string                 `json:"name" yaml:"name"`
	Disabled bool                   `json:"disabled,omitempty" yaml:"disabled,omitempty"`
	Content  map[string]interface{} `json:"content,omitempty" yaml:"content,omitempty"`
}

func NewVulkanLayersFile

func NewVulkanLayersFile(n string) *VulkanLayersFile

type VulkanLayersFiles

type VulkanLayersFiles struct {
	Path  string                       `json:"path" yaml:"path"`
	Files map[string]*VulkanLayersFile `json:"files,omitempty" yaml:"files,omitempty"`
}

func NewVulkanLayersFiles

func NewVulkanLayersFiles(dir string) *VulkanLayersFiles

Jump to

Keyboard shortcuts

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