pkg_kit

package
v1.11.1 Latest Latest
Warning

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

Go to latest
Published: Oct 27, 2024 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

View Source
const (
	PkgVersionRegexp     = `^(\W*)(\"version\")(\W*\:\W*)(\".*\")(\W*\,\W*)$`
	PkgVersionGroupIndex = 4
)

Variables

This section is empty.

Functions

func FetchNowBuildId

func FetchNowBuildId() string

func FetchNowVersion

func FetchNowVersion() string

func GetPackageJsonDescription

func GetPackageJsonDescription() string

func GetPackageJsonHomepage

func GetPackageJsonHomepage() string

func GetPackageJsonName

func GetPackageJsonName() string

func GetPackageJsonVersion

func GetPackageJsonVersion() string

func GetPackageJsonVersionGoStyle

func GetPackageJsonVersionGoStyle(onlyKeepVersion bool) string

func InitPkgJsonContent

func InitPkgJsonContent(content string)

InitPkgJsonContent

initialization will change the global variable pkgJsonContent

func ReplaceFileLineByLine

func ReplaceFileLineByLine(path string, reg string, index int, replace string) error

ReplaceFileLineByLine

read file as lines, this method will read all line, so if file is too big, will be slow

func ReplaceJsonVersionByLine

func ReplaceJsonVersionByLine(path string, versionNoPrefix string) error

ReplaceJsonVersionByLine replace json version by line

func ReplaceVersion

func ReplaceVersion(path string, version string) error

ReplaceVersion this way is not good, but it's work, will change json order

func SetVersionPrefixGoStyle

func SetVersionPrefixGoStyle(prefix string)

Types

type Author

type Author struct {

	// Name
	//
	Name string `json:"name,omitempty"`

	// Email
	//
	Email string `json:"email,omitempty"`

	// Url
	//
	Url string `json:"url,omitempty"`
}

Author struct

func GetPackageJsonAuthor

func GetPackageJsonAuthor() Author

type Bugs

type Bugs struct {

	// Url
	//
	Url string `json:"url,omitempty"`
}

Bugs struct

type BuildInfo

type BuildInfo struct {
	PkgName string `json:"pkgName"`

	Version    string `json:"version"`
	RawVersion string `json:"rawVersion"`
	BuildId    string `json:"buildId"`

	GoVersion    string `json:"goVersion"`
	GitCommit    string `json:"gitCommit"`
	GitTreeState string `json:"gitTreeState"`
	Date         string `json:"date"`
	Compiler     string `json:"compiler"`
	Platform     string `json:"platform"`

	AuthorName         string `json:"authorName"`
	CopyrightStartYear string `json:"copyrightStartYear"`
	CopyrightNowYear   string `json:"copyrightNowYear"`
}

func NewBuildInfo

func NewBuildInfo(
	pkgName, version, rawVersion,
	buildId, commit, date,
	author, copyrightStartYear string,
) BuildInfo

func (BuildInfo) Copyright

func (b BuildInfo) Copyright() string

func (BuildInfo) PgkNameString

func (b BuildInfo) PgkNameString() string

func (BuildInfo) RawVersionString

func (b BuildInfo) RawVersionString() string

func (BuildInfo) String

func (b BuildInfo) String() string

func (BuildInfo) VersionString

func (b BuildInfo) VersionString() string

type Directories

type Directories struct {

	// Doc
	//
	Doc string `json:"doc,omitempty"`
}

Directories struct

type PkgJson

type PkgJson struct {
	// Name
	//
	Name string `json:"name"`

	// Version
	//
	Version string `json:"version"`

	// Author
	//
	Author Author `json:"author"`

	// Description
	//
	Description string `json:"description,omitempty"`

	// Directories
	//
	Directories Directories `json:"directories,omitempty"`

	// Repository
	//
	Repository Repository `json:"repository,omitempty"`

	// Keywords
	//
	Keywords []string `json:"keywords,omitempty"`

	// License
	//
	License string `json:"license,omitempty"`

	// Bugs
	//
	Bugs Bugs `json:"bugs,omitempty"`

	// Homepage
	//
	Homepage string `json:"homepage,omitempty"`
}

PkgJson

struct of package.json

type Repository

type Repository struct {

	// Type
	//
	Type string `json:"type,omitempty"`

	// Url
	//
	Url string `json:"url,omitempty"`
}

Repository struct

Jump to

Keyboard shortcuts

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