Browse Source

Reorganize types

pull/8/head
Daniel Martí 11 years ago
parent
commit
450e69c2b8
  1. 5
      fieldtypes.go
  2. 41
      index.go

5
fieldtypes.go

@ -34,6 +34,11 @@ func (cl *CommaList) UnmarshalText(text []byte) (err error) {
return nil
}
type HexHash struct {
Type string `xml:"type,attr"`
Data HexVal `xml:",chardata"`
}
type HexVal []byte
func (hv *HexVal) FromString(s string) error {

41
index.go

@ -49,29 +49,6 @@ type App struct {
CurApk *Apk
}
type HexHash struct {
Type string `xml:"type,attr"`
Data HexVal `xml:",chardata"`
}
// Apk is an Android package
type Apk struct {
VName string `xml:"version"`
VCode int `xml:"versioncode"`
Size int64 `xml:"size"`
MinSdk int `xml:"sdkver"`
MaxSdk int `xml:"maxsdkver"`
ABIs CommaList `xml:"nativecode"`
ApkName string `xml:"apkname"`
SrcName string `xml:"srcname"`
Sig HexVal `xml:"sig"`
Added DateVal `xml:"added"`
Perms CommaList `xml:"permissions"`
Feats CommaList `xml:"features"`
Hash HexHash `xml:"hash"`
Repo *Repo
}
func (app *App) TextDesc(w io.Writer) {
reader := strings.NewReader(app.Desc)
decoder := xml.NewDecoder(reader)
@ -163,6 +140,24 @@ func (app *App) TextDesc(w io.Writer) {
}
}
// Apk is an Android package
type Apk struct {
VName string `xml:"version"`
VCode int `xml:"versioncode"`
Size int64 `xml:"size"`
MinSdk int `xml:"sdkver"`
MaxSdk int `xml:"maxsdkver"`
ABIs CommaList `xml:"nativecode"`
ApkName string `xml:"apkname"`
SrcName string `xml:"srcname"`
Sig HexVal `xml:"sig"`
Added DateVal `xml:"added"`
Perms CommaList `xml:"permissions"`
Feats CommaList `xml:"features"`
Hash HexHash `xml:"hash"`
Repo *Repo
}
type appList []App
func (al appList) Len() int { return len(al) }

Loading…
Cancel
Save