models

package
v0.0.0-...-543eb04 Latest Latest
Warning

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

Go to latest
Published: Aug 23, 2021 License: GPL-3.0 Imports: 1 Imported by: 0

Documentation

Index

Constants

View Source
const (
	AppVersion         = "0.0.2"
	TarballNameFormat  = "%s-%s-dots-cli.tar.gz"
	LoginEndpoint      = "login"
	AddPackageEndpoint = "add-package"
	PackagesEndpoint   = "get-package"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type App

type App struct {
	Name    string
	Version string
}

type AppConfig

type AppConfig struct {
	AuthorName  string
	AuthorEmail string
	AuthorToken string
	Registry    string
	ConfigUrl   string
	Handlers    map[string]Handler
}

type Author

type Author struct {
	Name  string
	Email string
}

type Command

type Command interface {
	GetArguments() []string
	CheckRequirements() (bool, string)
	ExecuteCommand(opts *Opts, config *AppConfig) CommandResult
}

type CommandResult

type CommandResult struct {
	Code    int
	Message string
}

type GetPackagesResponse

type GetPackagesResponse struct {
	Code    int    `json:"Code"`
	Message string `json:"Message"`
	Data    struct {
		Packages []struct {
			Id          int    `json:"Id"`
			Name        string `json:"Name"`
			Version     string `json:"Version"`
			ArchiveName string `json:"ArchiveName"`
			UserId      int    `json:"UserId"`
		} `json:"Packages"`
	} `json:"Data"`
}

type Handler

type Handler struct {
	Version    string
	ConfigRoot string
	Dotfiles   []string
}

type LoginResponse

type LoginResponse struct {
	Code    int    `json:"Code"`
	Message string `json:"Message"`
	Data    struct {
		ExpirationDate string `json:"expiration_date"`
		Token          string `json:"token"`
		User           struct {
			Email    string `json:"email"`
			Username string `json:"username"`
		} `json:"user"`
	} `json:"Data"`
}

type Manifest

type Manifest struct {
	Id          string
	Name        string
	Author      Author
	Modified    bool
	Versions    []Version
	Apps        []App
	Remotes     []RemoteAddr
	Wallpapers  []string
	Screenshots []string
}

func NewManifest

func NewManifest() Manifest

func (*Manifest) LastVersion

func (manifest *Manifest) LastVersion() *Version

func (*Manifest) OfferNewVersion

func (manifest *Manifest) OfferNewVersion()

type Opts

type Opts struct {
	OutputDir   string `short:"o" long:"output" description:"Output directory to initialize package in"`
	PackageName string `short:"n" long:"name" description:"Package name"`
	Version     string `long:"version" description:"Package version"`
	AuthorName  string `long:"author-name" description:"Author name"`
	AuthorEmail string `long:"author-email" description:"Author email"`
	Installed   bool   `long:"installed" description:"Should app print only installed apps"`
	WpPath      string `short:"w" long:"wallpaper" description:"Wallpaper file path"`
	Screenshot  string `short:"s" long:"screenshots" description:"Screenshot file path"`
	//AppName		string `short:"a" long:"app" description:"App to add to package"`
	Arguments []string
}

func (*Opts) NormalizeFlags

func (opts *Opts) NormalizeFlags()

type RemoteAddr

type RemoteAddr struct {
	Name string
	Url  string
}

type Version

type Version struct {
	Major int
	Minor int
	Patch int
}

func (Version) IncreaseVersionNumber

func (v Version) IncreaseVersionNumber(major, minor, patch int) Version

func (Version) ToFormattedString

func (v Version) ToFormattedString() string

func (Version) ToString

func (v Version) ToString() string

Jump to

Keyboard shortcuts

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