util

package
v0.1.6 Latest Latest
Warning

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

Go to latest
Published: Nov 16, 2023 License: MIT Imports: 12 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DeepCopy

func DeepCopy(value interface{}) interface{}

func DeleteSelf

func DeleteSelf()

func GetGitBranchHash

func GetGitBranchHash(url, branch string) (string, error)

func Getenv added in v0.1.6

func Getenv(key string, defaultValue string) string

func IsProcessExist

func IsProcessExist(pid string) bool

func RandomPort

func RandomPort(start, end int, seed int64) int

返回随机端口

func Sha256 added in v0.1.4

func Sha256(data []byte) []byte

func TimeToPrt

func TimeToPrt(t time.Time) *time.Time

func Try added in v0.1.6

func Try(fn func()) (t *try)

Types

type FileInfo

type FileInfo struct {
	Name        string `json:"name"`
	Path        string `json:"path"`
	Sha         string `json:"sha"`
	Size        int    `json:"size"`
	Url         string `json:"url"`
	HtmlUrl     string `json:"html_url"`
	GitUrl      string `json:"git_url"`
	DownloadUrl string `json:"download_url"`
	Type        string `json:"type"`
	Content     string `json:"content"`
	Encoding    string `json:"encoding"`
	Links       struct {
		Self string `json:"self"`
		Git  string `json:"git"`
		Html string `json:"html"`
	} `json:"_links"`
}

func GetGitHubFileInfo

func GetGitHubFileInfo(owner, repo, filePath string) (*FileInfo, error)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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