Documentation ¶
Index ¶
- Variables
- func SetLogLevel(l log.Level)
- func SetLogOutput(i io.Writer)
- func SetOptions(opt Options)
- type Model
- type Models
- type Options
- type Package
- type Packages
- func (p Packages) FilterByArch(query string) Packages
- func (p Packages) FilterByFirmware(query string) Packages
- func (p Packages) FilterOutBeta() Packages
- func (p Packages) Len() int
- func (p Packages) Less(i, j int) bool
- func (p Packages) OnlyShowLastVersion() Packages
- func (p Packages) SearchByName(query string) Packages
- func (p Packages) Swap(i, j int)
Constants ¶
This section is empty.
Variables ¶
var Families map[string][]string
Families contains families - arch mappings
var LogDebugLevel = func() log.Level { return log.DebugLevel }()
LogDebugLevel is a shorthand for logrus.DebugLevel
var LogErrorLevel = func() log.Level { return log.ErrorLevel }()
LogErrorLevel is a shorthand for logrus.ErrorLevel
var LogFatalLevel = func() log.Level { return log.FatalLevel }()
LogFatalLevel is a shorthand for logrus.FatalLevel
var LogInfoLevel = func() log.Level { return log.InfoLevel }()
LogInfoLevel is a shorthand for logrus.InfoLevel
var LogPanicLevel = func() log.Level { return log.PanicLevel }()
LogPanicLevel is a shorthand for logrus.PanicLevel
var LogWarnLevel = func() log.Level { return log.WarnLevel }()
LogWarnLevel is a shorthand for logrus.WarnLevel
Functions ¶
Types ¶
type Model ¶
type Model struct { Name string `json:"name,omitempty"` CPU string `json:"cpu,omitempty"` Cores string `json:"cores,omitempty"` Threads string `json:"threads,omitempty"` FPU string `json:"fpu,omitempty"` Arch string `json:"arch,omitempty"` RAM string `json:"ram,omitempty"` }
Model represents a Synology model
type Models ¶
type Models []*Model
Models is a slice of Model
func (Models) FilterByName ¶
FilterByName filters models by name
func (Models) SaveModelsFile ¶
SaveModelsFile saves the model file to o.ModelsFile
type Options ¶
type Options struct { PackagesDir string CacheDir string ModelsFile string Language string MD5 bool }
Options holds external context
type Package ¶
type Package struct { // Mandatory fields Name string `json:"package,omitempty"` DisplayName string `json:"dname,omitempty"` Version string `json:"version,omitempty"` Firmware string `json:"firmware,omitempty"` // Replaced by OsMinimumVersion after 6.1-14715 OSMinimumVersion string `json:"os_min_ver,omitempty"` Description string `json:"desc,omitempty"` Arch string `json:"arch,omitempty"` Maintainer string `json:"maintainer,omitempty"` PackageIcon string `json:"package_icon,omitempty"` PackageIcon256 string `json:"package_icon_256,omitempty"` // Optional fields MaintainerURL string `json:"maintainer_url,omitempty"` Distributor string `json:"distributor,omitempty"` DistributorURL string `json:"distributor_url,omitempty"` SupportURL string `json:"support_url,omitempty"` SupportCenter string `json:"support_center, omitempty"` Model string `json:"model,omitempty"` ExcludeArch string `json:"exclude_arch,omitempty"` //maybe handle that ? Checksum string `json:"checksum,omitempty"` AdminPort string `json:"adminport,omitempty"` AdminURL string `json:"adminurl,omitempty"` AdminProtocol string `json:"adminprotocol,omitempty"` DSMUIDir string `json:"dsmuidir,omitempty"` DSMAppDir string `json:"dsmappdir,omitempty"` Changelog string `json:"changelog,omitempty"` CheckPort bool `json:"checkport,omitempty"` Startable bool `json:"startable,omitempty"` // Replaced by ConstrolStop after 6.1-14907 ConstrolStop bool `json:"ctl_stop,omitempty"` ConstrolUninstall bool `json:"ctl_uninstall,omitempty"` PreCheckStartStop bool `json:"precheckstartstop,omitempty"` HelpURL string `json:"helpurl,omitempty"` Beta bool `json:"beta,omitempty"` ReportURL string `json:"report_url,omitempty"` InstallReboot bool `json:"install_reboot,omitempty"` InstallDepPackages string `json:"install_dep_packages,omitempty"` InstallConflictPackages string `json:"install_conflict_packages,omitempty"` InstallBreakPackages string `json:"install_break_packages,omitempty"` InstallReplacePackages string `json:"install_replace_packages,omitempty"` InstUninstRestartServices string `json:"instuninst_restart_services,omitempty"` StartStopRestartServices string `json:"startstop_restart_services,omitempty"` InstallDepServices string `json:"install_dep_services,omitempty"` StartDepServices bool `json:"start_dep_services,omitempty"` ExtractSize string `json:"extractsize,omitempty"` SupportConfFolder bool `json:"support_conf_folder,omitempty"` // Deprecated after 6.0 InstallType string `json:"install_type,omitempty"` SilentInstall bool `json:"silent_install,omitempty"` SilentUpgrade bool `json:"silent_upgrade,omitempty"` SilentUninstall bool `json:"silent_uninstall,omitempty"` AutoUpgradeFrom string `json:"auto_upgrade_from,omitempty"` OfflineInstall bool `json:"offline_install,omitempty"` ThirdParty bool `json:"thirdparty,omitempty"` OSMaximumVersion bool `json:"os_max_ver,omitempty"` // Package Center metadata Start bool `json:"start,omitempty"` Price string `json:"price,omitempty"` DownloadCount string `json:"download_count,omitempty"` ServiceDependencies string `json:"depsers,omitempty"` PackagesDependencies string `json:"deppkgs,omitempty"` PackagesConflicts string `json:"conflictpkgs,omitempty"` RecentDownloadCount string `json:"recent_download_count,omitempty"` Link string `json:"link,omitempty"` Size string `json:"size,omitempty"` MD5 string `json:"md5,omitempty"` QuickInstall bool `json:"qinst,omitempty"` QuickStart bool `json:"qstart,omitempty"` QuickUpgrade bool `json:"qupdate,omitempty"` Thumbnail []string `json:"thumbnail,omitempty"` ThumbnailRetina []string `json:"thumbnail_retina,omitempty"` Snapshot []string `json:"snapshot,omitempty"` Category string `json:"category,omitempty"` SubCategory string `json:"subcategory,omitempty"` Type string `json:"type,omitempty"` // contains filtered or unexported fields }
Package represents a Synology package
func NewDebugPackage ¶
NewDebugPackage creates a new debug package from the description string
func NewPackage ¶
NewPackage creates a new package from the spk file
func (*Package) ExistsOnDisk ¶
ExistsOnDisk returns true if the package file exists on disk
type Packages ¶
type Packages []*Package
Packages is a slice of Package
func (Packages) FilterByArch ¶
FilterByArch filters synopkgs where Arch = query
func (Packages) FilterByFirmware ¶
FilterByFirmware filters synopkgs where Version >= query
func (Packages) FilterOutBeta ¶
FilterOutBeta returns synopkgs except beta packages
func (Packages) OnlyShowLastVersion ¶
OnlyShowLastVersion overrides an existing package with a new one if the version is greater the comparison is done on the Name property
func (Packages) SearchByName ¶
SearchByName filters synopkgs name contains query