models

package
v1.3.2 Latest Latest
Warning

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

Go to latest
Published: Jan 31, 2020 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DateOnlyFormat    = "20060102"
	HumanDateTemplate = "%d %s %d"
)

Public consts

Variables

This section is empty.

Functions

This section is empty.

Types

type APIRecord

type APIRecord struct {
	VariantList []APIVariant `json:"variants"`
}

APIRecord holds all of the gapps Variants

type APIVariant

type APIVariant struct {
	Name         string `json:"name"`
	ZIP          string `json:"zip"`
	ZIPSize      int64  `json:"zip_size"`
	MD5          string `json:"md5"`
	VersionInfo  string `json:"version_info"`
	SourceReport string `json:"source_report"`
}

APIVariant describes gapps Variant

type ArchRecord

type ArchRecord struct {
	APIList   map[string]APIRecord `json:"apis"`
	Date      string               `json:"date"`
	HumanDate string               `json:"human_date"`
}

ArchRecord holds the list of gapps Variants per API and its date

type DownloadResponse

type DownloadResponse struct {
	ZIP          string `json:"zip,omitempty"`
	ZIPMirrors   string `json:"zip_mirrors,omitempty"`
	MD5          string `json:"md5,omitempty"`
	VersionInfo  string `json:"version_info,omitempty"`
	SourceReport string `json:"source_report,omitempty"`
	Error        string `json:"error,omitempty"`
	// contains filtered or unexported fields
}

DownloadResponse is used for the /download endpoint

func (*DownloadResponse) HasCriticalError

func (r *DownloadResponse) HasCriticalError() bool

HasCriticalError reports if we had an error which lead to the missing link

func (*DownloadResponse) SetField

func (r *DownloadResponse) SetField(field, value string)

SetField safely sets the field value

func (*DownloadResponse) ToJSON

func (r *DownloadResponse) ToJSON() []byte

ToJSON forms JSON body from a struct, ignoring Marshal error

type ListResponse

type ListResponse struct {
	ArchList map[string]ArchRecord `json:"archs,omitempty"`
	Error    string                `json:"error,omitempty"`
	// contains filtered or unexported fields
}

ListResponse is used for the /list endpoint

func (*ListResponse) AddPackage

func (r *ListResponse) AddPackage(date string, p gapps.Platform, a gapps.Android, v gapps.Variant) error

AddPackage safely adds the package to the ListResponse

func (*ListResponse) ToJSON

func (r *ListResponse) ToJSON() []byte

ToJSON forms JSON body from a struct, ignoring Marshal error

Jump to

Keyboard shortcuts

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