ipapi

package
v0.0.4 Latest Latest
Warning

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

Go to latest
Published: Jan 25, 2026 License: Apache-2.0 Imports: 5 Imported by: 2

Documentation

Index

Constants

View Source
const (
	OpPermRead   uint8 = 1 << 0
	OpPermWrite  uint8 = 1 << 1
	OpPermCreate uint8 = 1 << 2
	OpPermDelete uint8 = 1 << 3
	OpPermList   uint8 = 1 << 4
	OpPermOff    uint8 = 1 << 5
	OpPermPut    uint8 = OpPermWrite | OpPermCreate | OpPermDelete | OpPermOff
	OpPermMirror uint8 = OpPermRead | OpPermList
	OpPermAll    uint8 = OpPermRead | OpPermWrite | OpPermCreate | OpPermDelete | OpPermList | OpPermOff
)
View Source
const (
	PackAPIVersion = "0.1.0.dev"
)

Variables

View Source
var (
	ChannelNameRe   = regexp.MustCompile("^[a-z0-9]{3,10}$")
	ChannelVendorRe = regexp.MustCompile("^[a-zA-Z][a-zA-Z0-9-.]{2,49}$")
	PackNameRe      = regexp.MustCompile("^[a-zA-Z][a-zA-Z0-9-_]{1,28}[a-zA-Z0-9]$")
	VersionDistRe   = types.ArrayString([]string{"all", "linux", "el7", "el8"})
	VersionArchRe   = types.ArrayString([]string{"src", "x64"})
)
View Source
var (
	PackGroups = types.Labels{

		{
			Name:  "app/biz",
			Value: "Business",
		},
		{
			Name:  "app/co",
			Value: "Collaboration",
		},
		{
			Name:  "app/prod",
			Value: "Productivity",
		},
		{
			Name:  "app/dev",
			Value: "Development Tools",
		},
		{
			Name:  "app/other",
			Value: "App Others",
		},

		{
			Name:  "dev/web-static",
			Value: "Web Frontend Static Library",
		},
		{
			Name:  "dev/web-lib",
			Value: "Web Backend Library",
		},
		{
			Name:  "dev/sys-lib",
			Value: "System Library",
		},
		{
			Name:  "dev/db",
			Value: "Database Server or Service",
		},
		{
			Name:  "dev/stor",
			Value: "Storage Server or Service",
		},
		{
			Name:  "dev/sys-srv",
			Value: "System Server or Service",
		},
		{
			Name:  "dev/sys-runtime",
			Value: "System Runtime Environments",
		},
		{
			Name:  "dev/other",
			Value: "Dev Others",
		},
	}
)

Functions

func DataChannelKey

func DataChannelKey(name string) []byte

func DataInfoIconKey

func DataInfoIconKey(name, typ string) []byte

func DataInfoKey

func DataInfoKey(name string) []byte

func DataPackKey

func DataPackKey(name string) []byte

func OpPermAllow

func OpPermAllow(p, perms uint8) bool

func PackFilename

func PackFilename(name string, ver PackVersion) string

func PackFilenameKey

func PackFilenameKey(name string, ver PackVersion) string

func PackNameValid

func PackNameValid(name string) error

Types

type Pack

type Pack struct {
	Meta     types.InnerObjectMeta `json:"meta,omitempty" toml:"meta,omitempty"`
	Version  PackVersion           `json:"version,omitempty" toml:"version,omitempty"`
	Project  PackSpecProject       `json:"project,omitempty" toml:"project,omitempty"`
	Groups   types.ArrayString     `json:"groups,omitempty" toml:"groups,omitempty"`
	Labels   types.Labels          `json:"labels,omitempty" toml:"labels,omitempty"`
	Channel  string                `json:"channel,omitempty" toml:"channel,omitempty"`
	Built    types.MetaTime        `json:"built,omitempty" toml:"built,omitempty"`
	Size     int64                 `json:"size,omitempty" toml:"size,omitempty"`
	SumCheck string                `json:"sum_check,omitempty" toml:"sum_check,omitempty"`
	OpPerm   uint8                 `json:"op_perm,omitempty" toml:"op_perm,omitempty"`
}

func (*Pack) Valid

func (it *Pack) Valid() error

type PackBuild

type PackBuild struct {
	Name    string            `json:"name" toml:"name"`
	Version PackVersion       `json:"version" toml:"version"`
	Project PackSpecProject   `json:"project,omitempty" toml:"project,omitempty"`
	Groups  types.ArrayString `json:"groups,omitempty" toml:"groups,omitempty"`
	Labels  types.Labels      `json:"labels,omitempty" toml:"labels,omitempty"`
	Built   types.MetaTime    `json:"built,omitempty" toml:"built,omitempty"`
}

func (*PackBuild) Valid

func (it *PackBuild) Valid() error

type PackChannel

type PackChannel struct {
	types.TypeMeta `json:",inline" toml:",inline"`
	Meta           types.InnerObjectMeta `json:"meta,omitempty" toml:"meta,omitempty"`
	Type           string                `json:"type,omitempty" toml:"type,omitempty"`
	VendorName     string                `json:"vendor_name,omitempty" toml:"vendor_name,omitempty"`
	VendorAPI      string                `json:"vendor_api,omitempty" toml:"vendor_api,omitempty"`
	VendorSite     string                `json:"vendor_site,omitempty" toml:"vendor_site,omitempty"`
	Upstream       string                `json:"upstream,omitempty" toml:"upstream,omitempty"`
	StatNum        int64                 `json:"stat_num,omitempty" toml:"stat_num,omitempty"`
	StatNumOff     int64                 `json:"stat_num_off,omitempty" toml:"stat_num_off,omitempty"`
	StatSize       int64                 `json:"stat_size,omitempty" toml:"stat_size,omitempty"`
	StatSizeOff    int64                 `json:"stat_size_off,omitempty" toml:"stat_size_off,omitempty"`
	Roles          *PackChannelRoles     `json:"roles,omitempty" toml:"roles,omitempty"`
}

type PackChannelList

type PackChannelList struct {
	types.TypeMeta `json:",inline" toml:",inline"`
	Items          []*PackChannel `json:"items,omitempty" toml:"items,omitempty"`
}

type PackChannelRoles

type PackChannelRoles struct {
	Create types.ArrayUint32 `json:"create,omitempty" toml:"create,omitempty"`
	Read   types.ArrayUint32 `json:"read,omitempty" toml:"read,omitempty"`
	Write  types.ArrayUint32 `json:"write,omitempty" toml:"write,omitempty"`
}

type PackCommit

type PackCommit struct {
	types.TypeMeta `json:",inline" toml:",inline"`
	Name           string `json:"name" toml:"name"`
	Size           int64  `json:"size" toml:"size"`
	Channel        string `json:"channel" toml:"channel"`
	Data           string `json:"data" toml:"data"`
	SumCheck       string `json:"sumcheck" toml:"sumcheck"`
	AutoRelease    bool   `json:"auto_release" toml:"auto_release"`
	GitVersion     string `json:"git_version" toml:"git_version"`
}

type PackGroup

type PackGroup struct {
	Key         string `json:"key" toml:"key"`
	Name        string `json:"name" toml:"name"`
	Description string `json:"description,omitempty" toml:"description,omitempty"`
}

type PackGroupList

type PackGroupList struct {
	types.TypeMeta `json:",inline" toml:",inline"`
	Items          types.Labels `json:"items,omitempty" toml:"items,omitempty"`
}

type PackInfo

type PackInfo struct {
	types.TypeMeta
	Meta        types.InnerObjectMeta `json:"meta,omitempty" toml:"meta,omitempty"`
	Project     PackSpecProject       `json:"project,omitempty" toml:"project,omitempty"`
	LastVersion types.Version         `json:"last_version,omitempty" toml:"last_version,omitempty"`
	Groups      types.ArrayString     `json:"groups,omitempty" toml:"groups,omitempty"`
	StatNum     int64                 `json:"stat_num,omitempty" toml:"stat_num,omitempty"`
	StatSize    int64                 `json:"stat_size,omitempty" toml:"stat_size,omitempty"`
	StatNumOff  int64                 `json:"stat_num_off,omitempty" toml:"stat_num_off,omitempty"`
	StatSizeOff int64                 `json:"stat_size_off,omitempty" toml:"stat_size_off,omitempty"`
	Images      types.ArrayString     `json:"images,omitempty" toml:"images,omitempty"`
	OpPerm      uint8                 `json:"op_perm,omitempty" toml:"op_perm,omitempty"`
}

type PackInfoIcon

type PackInfoIcon struct {
	Mime string `json:"mime" toml:"mime"`
	Data string `json:"data" toml:"data"`
}

type PackInfoIconSet

type PackInfoIconSet struct {
	types.TypeMeta `json:",inline" toml:",inline"`
	Name           string `json:"name" toml:"name"`
	Type           string `json:"type" toml:"type"`
	Size           int64  `json:"size" toml:"size"`
	Data           string `json:"data,omitempty" toml:"data,omitempty"`
}

type PackInfoList

type PackInfoList struct {
	types.TypeMeta `json:",inline" toml:",inline"`
	Items          []PackInfo `json:"items,omitempty" toml:"items,omitempty"`
}

type PackList

type PackList struct {
	types.TypeMeta `json:",inline" toml:",inline"`
	Items          []*Pack `json:"items,omitempty" toml:"items,omitempty"`
}

type PackMultipartCommit

type PackMultipartCommit struct {
	types.TypeMeta `json:",inline" toml:",inline"`
	Name           string      `json:"name" toml:"name"`
	Version        PackVersion `json:"version" toml:"version"`
	Channel        string      `json:"channel" toml:"channel"`
	Size           int64       `json:"size" toml:"size"`
	BlockOffset    int64       `json:"blk_offset" toml:"blk_offset"`
	BlockData      string      `json:"blk_data" toml:"blk_data"`
	BlockCrc32     uint32      `json:"blk_crc32" toml:"blk_crc32"`
}

type PackSpec

type PackSpec struct {
	Project PackSpecProject `json:"project" toml:"project"`
	Files   PackSpecFiles   `json:"files" toml:"files"`
	Scripts PackSpecScripts `json:"scripts" toml:"scripts"`
}

type PackSpecAuthor

type PackSpecAuthor struct {
	Name  string `json:"name,omitempty" toml:"name,omitempty"`
	Email string `json:"email,omitempty" toml:"email,omitempty"`
}

type PackSpecFiles

type PackSpecFiles struct {
	Allow        string `json:"allow,omitempty" toml:"allow,omitempty"`
	JsCompress   string `json:"js_compress,omitempty" toml:"js_compress,omitempty"`
	CssCompress  string `json:"css_compress,omitempty" toml:"css_compress,omitempty"`
	HtmlCompress string `json:"html_compress,omitempty" toml:"html_compress,omitempty"`
	PngCompress  string `json:"png_compress,omitempty" toml:"png_compress,omitempty"`
}

type PackSpecProject

type PackSpecProject struct {
	Name        string            `json:"name,omitempty" toml:"name,omitempty"`
	Version     types.Version     `json:"version,omitempty" toml:"version,omitempty"`
	Release     types.Version     `json:"release,omitempty" toml:"release,omitempty"`
	Vendor      string            `json:"vendor,omitempty" toml:"vendor,omitempty"`
	License     string            `json:"license,omitempty" toml:"license,omitempty"`
	Homepage    string            `json:"homepage,omitempty" toml:"homepage,omitempty"`
	Source      *PackSpecSource   `json:"source,omitempty" toml:"source,omitempty"`
	Authors     []*PackSpecAuthor `json:"authors,omitempty" toml:"authors,omitempty"`
	Description string            `json:"description,omitempty" toml:"description,omitempty"`
	Groups      []string          `json:"groups,omitempty" toml:"groups,omitempty"`
	Keywords    []string          `json:"keywords,omitempty" toml:"keywords,omitempty"`
}

type PackSpecScripts

type PackSpecScripts struct {
	Build string `json:"build,omitempty" toml:"build,omitempty"`
}

type PackSpecSource

type PackSpecSource struct {
	Url string `json:"url,omitempty" toml:"url,omitempty"`
}

type PackVersion

type PackVersion struct {
	Version types.Version `json:"version" toml:"version"`
	Release types.Version `json:"release" toml:"release"`
	Dist    string        `json:"dist,omitempty" toml:"dist,omitempty"` // Distribution name
	Arch    string        `json:"arch,omitempty" toml:"arch,omitempty"` // Computer architecture
}

func (*PackVersion) Compare

func (it *PackVersion) Compare(cp PackVersion) int

func (*PackVersion) HashString

func (it *PackVersion) HashString() string

func (*PackVersion) Valid

func (it *PackVersion) Valid() error

Jump to

Keyboard shortcuts

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