util

package
v0.0.0-...-f944d32 Latest Latest
Warning

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

Go to latest
Published: Nov 18, 2021 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func FilenameNoExt

func FilenameNoExt(file string) string

func GenHTTPSGitURL

func GenHTTPSGitURL(host string, path string) string

GenHTTPSGitURL gen a git url in https protocol using host and path

func GenSSHGitURL

func GenSSHGitURL(host string, path string) string

GenSSHGitURL gen a git url in ssh protocol using host and path

func ListMatchFiles

func ListMatchFiles(root string, pattern string, ignores []string) []string

func ListMultiMatchFiles

func ListMultiMatchFiles(root string, patterns []string, ignores []string) []string

func ParseGitURL

func ParseGitURL(url string) (*url.URL, error)

ParseGitURL parse a git url

func RandString

func RandString(n int) string

RandString gen a n-byte rand string

func Tokenize

func Tokenize(text string) []*sentences.Sentence

Types

type MutexMap

type MutexMap struct {
	// contains filtered or unexported fields
}

MutexMap map multiple mutex using key

func NewMutexMap

func NewMutexMap() *MutexMap

NewMutexMap create a new MutexMap

func (*MutexMap) Lock

func (mm *MutexMap) Lock(key interface{}) Unlocker

Lock try to lock the (key, value)

type Unlocker

type Unlocker interface {
	Unlock()
}

Unlocker provides an Unlock method to release the lock.

Jump to

Keyboard shortcuts

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