nexus

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Jun 30, 2021 License: MIT Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CreateReleaseNote

func CreateReleaseNote(releases []*Release) (string, error)

func ModDir

func ModDir(mod *ModInfo, domain string) string

Types

type Condition

type Condition int
const (
	SameVersion Condition = iota
	NewerVersion
	OlderVersion
	InvalidVersion
)
type DownloadLink struct {
	Name      string `json:"name"`
	ShortName string `json:"short_name"`
	URI       string `json:"URI"`
}

type DownloadLinkApiResponse

type DownloadLinkApiResponse []DownloadLink

type File

type File struct {
	ID                   []int     `json:"id"`
	UID                  int       `json:"uid"`
	FileID               int       `json:"file_id"`
	Name                 string    `json:"name"`
	Version              string    `json:"version"`
	CategoryID           int       `json:"category_id"`
	CategoryName         string    `json:"category_name"`
	IsPrimary            bool      `json:"is_primary"`
	Size                 int       `json:"size"`
	FileName             string    `json:"file_name"`
	UploadedTimestamp    int       `json:"uploaded_timestamp"`
	UploadedTime         time.Time `json:"uploaded_time"`
	ModVersion           string    `json:"mod_version"`
	ExternalVirusScanUrl string    `json:"external_virus_scan_url"`
	Description          string    `json:"description"`
	SizeKB               int       `json:"size_kb"`
	SizeInBytes          int       `json:"size_in_bytes"`
	ChangelogHTML        string    `json:"changelog_html"`
	ContentPreviewLink   string    `json:"content_preview_link"`
}

func (*File) CmpTimestamp

func (p *File) CmpTimestamp(ts int) TsCondition

type FileUpdate

type FileUpdate struct {
	OldFileID         int       `json:"old_file_id"`
	NewFileID         int       `json:"new_file_id"`
	OldFileName       string    `json:"old_file_name"`
	NewFileName       string    `json:"new_file_name"`
	UploadedTimestamp int       `json:"uploaded_timestamp"`
	UploadedTime      time.Time `json:"uploaded_time"`
}

type FilesApiResponse

type FilesApiResponse struct {
	Files       []File
	FileUpdates []FileUpdate
}

type LocalFile

type LocalFile struct {
	Mod  *ModInfo
	Path string
}

func (*LocalFile) Move

func (p *LocalFile) Move(dstDir string) (string, error)

type ModInfo

type ModInfo struct {
	ID     int    `yaml:"id"`
	Name   string `yaml:"name"`
	Filter string `yaml:"filter,omitempty"`
	Author string `yaml:"author"`
	File   struct {
		FileID      int    `yaml:"fileId"`
		FileName    string `yaml:"fileName"`
		Name        string `yaml:"name"`
		SizeInBytes int    `yaml:"sizeInBytes"`
		Timestamp   int    `yaml:"timestamp"`
		Version     string `yaml:"version"`
	}
	UUID uuid.UUID `yaml:"uuid"`
}

type ModInfoSet

type ModInfoSet map[string][]*ModInfo

func (*ModInfoSet) Export

func (p *ModInfoSet) Export(filePath string) error

func (*ModInfoSet) Setup

func (p *ModInfoSet) Setup(f string) error

func (*ModInfoSet) Update

func (p *ModInfoSet) Update(release *Release) bool

type Release

type Release struct {
	Domain string
	Mod    *ModInfo
	File   *File
}

type TsCondition

type TsCondition int
const (
	SameTimestamp TsCondition = iota
	NewerTimestamp
	OlderTimestamp
)

type Version

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

func (*Version) Cmp

func (p *Version) Cmp(ver *Version) Condition

func (*Version) Parse

func (p *Version) Parse(ver string) bool

func (*Version) String

func (p *Version) String() string

type VersionPair

type VersionPair struct {
	Main int
	Sub  int
}

Jump to

Keyboard shortcuts

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