utils

package
v0.0.0-...-22aafd3 Latest Latest
Warning

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

Go to latest
Published: Jul 6, 2023 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

View Source
const (
	IsBare         = true
	IsMirror       = true
	GitUserName    = "git"
	DestRemoteName = "dest"

	GitProto   = "git"
	SshProto   = "ssh"
	HttpProto  = "http"
	HttpsProto = "https"

	TmpPathPattern = "repo"
)

Variables

View Source
var (
	DefaultTmpPath = fmt.Sprintf("%s/%s/%s", os.TempDir(), TmpPathPattern, uuid.NewString())
)

Functions

func BytesToString

func BytesToString(b []byte) string

BytesToString converts byte slice to string without a memory allocation.

func GoRoutine

func GoRoutine(method func())

func Guard

func Guard()

func IgnoreHostKeyCB

func IgnoreHostKeyCB(_ string, _ net.Addr, _ ssh.PublicKey) error

Types

type Any

type Any[K comparable] map[K]Empty

func AnyKeySet

func AnyKeySet[K comparable, V any](theMap map[K]V) Any[K]

func NewAnySet

func NewAnySet[K comparable](items ...K) Any[K]

func (Any[K]) Delete

func (s Any[K]) Delete(items ...K) Any[K]

func (Any[K]) Difference

func (s Any[K]) Difference(s2 Any[K]) Any[K]

func (Any[K]) Equal

func (s Any[K]) Equal(s2 Any[K]) bool

func (Any[K]) Has

func (s Any[K]) Has(item K) bool

func (Any[K]) HasAll

func (s Any[K]) HasAll(items ...K) bool

func (Any[K]) HasAny

func (s Any[K]) HasAny(items ...K) bool

func (Any[K]) Insert

func (s Any[K]) Insert(items ...K) Any[K]

func (Any[K]) Intersection

func (s Any[K]) Intersection(s2 Any[K]) Any[K]

func (Any[K]) IsSuperset

func (s Any[K]) IsSuperset(s2 Any[K]) bool

IsSuperset returns true if and only if s1 is a superset of s2.

func (Any[K]) Len

func (s Any[K]) Len() int

func (Any[K]) List

func (s Any[K]) List() []K

func (Any[K]) PopAny

func (s Any[K]) PopAny() (K, bool)

func (Any[K]) Union

func (s Any[K]) Union(s2 Any[K]) Any[K]

type Empty

type Empty struct{}

Jump to

Keyboard shortcuts

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