xversion

package
v0.25.15 Latest Latest
Warning

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

Go to latest
Published: Apr 21, 2024 License: Apache-2.0 Imports: 10 Imported by: 4

README

GoKit - xversion

Version kits for Golang development.

Installation

go get -u github.com/likexian/gokit

Importing

import (
    "github.com/likexian/gokit/xversion"
)

Documentation

Visit the docs on GoDoc

Example

req := &CheckUpdateRequest{
    Product:       "test",
    Current:       "1.0.0",
    CacheFile:     "check_cache_file",
    CacheDuration: 1 * time.Hour,
    CheckPoint:    "https://check_url/",
}

ctx := context.Background()
rsp, err := req.Run(ctx)
if err != nil {
    panic(err)
} else {
    fmt.Println(rsp.Outdated)
}

License

Copyright 2012-2024 Li Kexian

Licensed under the Apache License 2.0

Donation

If this project is helpful, please share it with friends.

If you want to thank me, you can give me a cup of coffee.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Author

func Author() string

Author returns package author

func License

func License() string

License returns package license

func Version

func Version() string

Version returns package version

Types

type CheckUpdateRequest

type CheckUpdateRequest struct {
	Product       string        `json:"product"`
	Current       string        `json:"current"`
	Arch          string        `json:"arch"`
	OS            string        `json:"os"`
	CacheFile     string        `json:"-"`
	CacheDuration time.Duration `json:"-"`
	CheckPoint    string        `json:"-"`
}

CheckUpdateRequest is check update request

func (*CheckUpdateRequest) Run

func (req *CheckUpdateRequest) Run(ctx context.Context) (rsp *CheckUpdateResponse, err error)

Run do check update

type CheckUpdateResponse

type CheckUpdateResponse struct {
	Product     string `json:"product"`
	Current     string `json:"current"`
	Latest      string `json:"latest"`
	Outdated    bool   `json:"outdated"`
	Emergency   bool   `json:"emergency"`
	DownloadURL string `json:"download_url"`
	ProductURL  string `json:"product_url"`
}

CheckUpdateResponse is check update response

Jump to

Keyboard shortcuts

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