Documentation ¶
Index ¶
- Variables
- func Check(machineID, domain string) error
- func Download(machineID, domain string) error
- func Error() error
- func Exists() bool
- func FileName() string
- func FilePath() string
- func FullLicenseURL(machineID, domain string) string
- func Generate(privBytes []byte, pemSaveDirs ...string) error
- func License() lib.LicenseData
- func MachineID() (string, error)
- func Ok(domain string) bool
- func ProductURL() string
- func PublicKey() string
- func Save(b []byte) error
- func SetPublicKey(pubkey string)
- func SetServerURL(s *ServerURL)
- func SetVersion(version string)
- func TrackerURL() string
- func Validate() error
- func Version() string
- type OfficialData
- type OfficialResp
- type ProductVersion
- type ServerURL
- type ValidResp
- type ValidResult
- type Validation
- type Validator
- type VersionResp
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ErrLicenseNotFound = errors.New(`License does not exist`) SkipLicenseCheck = true )
View Source
var ( ErrConnectionNotFound = errors.New(`连接授权服务器失败`) ErrOfficialDataUnexcepted = errors.New(`官方数据返回异常`) )
View Source
var NewValidResp = func() *ValidResp { return &ValidResp{Data: &ValidResult{}} }
Functions ¶
func FullLicenseURL ¶
FullLicenseURL 包含完整参数的授权网址
func License ¶
func License() lib.LicenseData
func ProductURL ¶
func ProductURL() string
func SetPublicKey ¶
func SetPublicKey(pubkey string)
func SetServerURL ¶
func SetServerURL(s *ServerURL)
func SetVersion ¶
func SetVersion(version string)
func TrackerURL ¶
func TrackerURL() string
Types ¶
type OfficialData ¶
type OfficialData struct { lib.LicenseData Timestamp int64 }
type OfficialResp ¶
type OfficialResp struct { Code int Info string Zone string `json:",omitempty" xml:",omitempty"` Data *OfficialData `json:",omitempty" xml:",omitempty"` }
type ProductVersion ¶
type ProductVersion struct { Id uint64 `db:"id,omitempty,pk" bson:"id,omitempty" comment:"ID" json:"id" xml:"id"` ProductId uint64 `db:"product_id" bson:"product_id" comment:"产品ID" json:"product_id" xml:"product_id"` Version string `db:"version" bson:"version" comment:"版本号(格式1.0.1)" json:"version" xml:"version"` Type string `db:"type" bson:"type" comment:"版本类型(stable-稳定版;beta-公测版;alpha-内测版)" json:"type" xml:"type"` Os string `db:"os" bson:"os" comment:"支持的操作系统(多个用逗号分隔),留空表示不限制" json:"os" xml:"os"` Arch string `db:"arch" bson:"arch" comment:"硬件架构(多个用逗号分隔),留空表示不限制" json:"arch" xml:"arch"` ReleasedAt uint `db:"released_at" bson:"released_at" comment:"发布时间" json:"released_at" xml:"released_at"` Created uint `db:"created" bson:"created" comment:"创建时间" json:"created" xml:"created"` Updated uint `db:"updated" bson:"updated" comment:"修改时间" json:"updated" xml:"updated"` Disabled string `db:"disabled" bson:"disabled" comment:"是否禁用" json:"disabled" xml:"disabled"` Audited string `db:"audited" bson:"audited" comment:"是否已审核" json:"audited" xml:"audited"` ForceUpgrade string `db:"force_upgrade" bson:"force_upgrade" comment:"是否强行升级为此版本" json:"force_upgrade" xml:"force_upgrade"` Description string `db:"description" bson:"description" comment:"发布说明" json:"description" xml:"description"` Remark string `db:"remark" bson:"remark" comment:"备注" json:"remark" xml:"remark"` DownloadUrl string `db:"download_url" bson:"download_url" comment:"下载网址" json:"download_url" xml:"download_url"` Sign string `db:"sign" bson:"sign" comment:"下载后验证签名(多个签名之间用逗号分隔)" json:"sign" xml:"sign"` DownloadUrlOther string `` /* 129-byte string literal not displayed */ }
type ServerURL ¶
type ValidResult ¶
type ValidResult struct { }
func (*ValidResult) Validate ¶
func (v *ValidResult) Validate() error
type Validation ¶
type Validation struct {
NowVersions []string
}
Validation 定义验证器
func (*Validation) Validate ¶
func (v *Validation) Validate(data *lib.LicenseData) error
Validate 参数验证器
type VersionResp ¶
type VersionResp struct { Code int Info string Zone string `json:",omitempty" xml:",omitempty"` Data *ProductVersion `json:",omitempty" xml:",omitempty"` }
Click to show internal directories.
Click to hide internal directories.