utils

package
v1.6.4 Latest Latest
Warning

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

Go to latest
Published: Jun 15, 2022 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DistinctStringSlice

func DistinctStringSlice(s []string) []string

func Dos2UnixWriter

func Dos2UnixWriter(w io.Writer) io.WriteCloser

func InStringSlice

func InStringSlice(slice []string, s string) bool

func IsDir

func IsDir(path string) bool

func IsFile

func IsFile(path string) bool

func IsPathExist

func IsPathExist(path string) bool

func JoinStringAny

func JoinStringAny(sep string, a ...fmt.Stringer) string

func MaxInt

func MaxInt(a, b int) int

func MinInt

func MinInt(a, b int) int

func ReadFileLimited

func ReadFileLimited(p string, maxRead int64) ([]byte, error)

func Unix2DosWriter

func Unix2DosWriter(w io.Writer) io.WriteCloser

Types

type StringSet

type StringSet map[string]struct{}

func NewStringSet

func NewStringSet() StringSet

func (StringSet) Contains

func (s StringSet) Contains(t string) bool

func (StringSet) Put

func (s StringSet) Put(t string) StringSet

func (StringSet) ToSlice

func (s StringSet) ToSlice() []string

type SuffixBuffer

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

func NewSuffixBuffer

func NewSuffixBuffer(size int) *SuffixBuffer

func (*SuffixBuffer) Bytes

func (s *SuffixBuffer) Bytes() []byte

func (*SuffixBuffer) String

func (s *SuffixBuffer) String() string

func (*SuffixBuffer) Truncated

func (s *SuffixBuffer) Truncated() bool

func (*SuffixBuffer) Write

func (s *SuffixBuffer) Write(data []byte) (n int, e error)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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