apkg

package
v0.0.0-...-6b0fc1c Latest Latest
Warning

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

Go to latest
Published: Jan 1, 2018 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	General  GeneralConfig   `json:"general"`
	Desktop  *DesktopConfig  `json:"desktop,omitempty"`
	Register *RegisterConfig `json:"register,omitempty"`
}

Config represents the ASUSTOR package (apkg) configuration.

type DesktopConfig

type DesktopConfig struct {
	App *struct {
		Type      string `json:"type,omitempty"`
		SessionID string `json:"session-id,omitempty"`
		Protocol  string `json:"protocol,omitempty"`
		Port      int    `json:"port,omitempty"`
		URL       string `json:"url,omitempty"`
	} `json:"app,omitempty"`
	Privilege *struct {
		Accessible   string `json:"accessible,omitempty"`
		Customizable bool   `json:"customizable,omitempty"`
	} `json:"privilege,omitempty"`
}

DesktopConfig represents the desktop configuration.

type File

type File struct {
	// contains filtered or unexported fields
}

File is the opened apkg.

func Open

func Open(name string) (*File, error)

func (*File) Changelog

func (f *File) Changelog() io.ReadCloser

Changelog returns

func (*File) Close

func (f *File) Close() error

func (*File) Config

func (f *File) Config() (*Config, error)

Config parses config.json into Config.

func (*File) Description

func (f *File) Description() io.ReadCloser

func (*File) Path

func (f *File) Path() string

type GeneralConfig

type GeneralConfig struct {
	Package      string   `json:"package,omitempty"`
	Name         string   `json:"name,omitempty"`
	Version      string   `json:"version,omitempty"`
	Depends      []string `json:"depends,omitempty"`
	Conflicts    []string `json:"conflicts,omitempty"`
	Developer    string   `json:"developer,omitempty"`
	Maintainer   string   `json:"maintainer,omitempty"`
	Email        string   `json:"email,omitempty"`
	Website      string   `json:"website,omitempty"`
	Architecture string   `json:"architecture,omitempty"`
	Firmware     string   `json:"firmware,omitempty"`
	Model        string   `json:"model,omitempty"`
	DefaultLang  string   `json:"default-lang,omitempty"`
	MemoryLimit  int      `json:"memory-limit,omitempty"`
	MemoryAdvice int      `json:"memory-advice,omitempty"`
}

GeneralConfig represents the general package configuration.

type RegisterConfig

type RegisterConfig struct {
	SymbolicLink map[string][]string `json:"symbolic-link,omitempty"`
	ShareFolder  []struct {
		Name        string `json:"name,omitempty"`
		Description string `json:"description,omitempty"`
	} `json:"share-folder,omitempty"`
	Port         []int `json:"port,omitempty"`
	BootPriority *struct {
		StartOrder int `json:"start-order,omitempty"`
		StopOrder  int `json:"stop-order,omitempty"`
	} `json:"boot-priority,omitempty"`
	Prerequisites *struct {
		EnableService  []string `json:"enable-service,omitempty"`
		RestartService []string `json:"restart-service,omitempty"`
	} `json:"prerequisites,omitempty"`
}

RegisterConfig represents the register configuration.

Jump to

Keyboard shortcuts

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