utils

package
v0.19.24 Latest Latest
Warning

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

Go to latest
Published: Apr 7, 2022 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CreateIfNotExists added in v0.3.4

func CreateIfNotExists(path string, mode os.FileMode, fs afero.Fs) error

CreateIfNotExists examines a path and if it is not present, creates the passed file type for the given path

func ExtractURLs added in v0.6.17

func ExtractURLs(urlStr string) ([]*url.URL, error)

ExtractURLs extracts a list of valid URLs from a given URL

func FilterGitHubURLs added in v0.6.17

func FilterGitHubURLs(urls []*url.URL, host string) []*url.URL

FilterGitHubURLs returns a list of valid GitHub URLs given a list of URLs

func StringInSlice

func StringInSlice(s string, sl []string) bool

StringInSlice checks whether a given string is in a slice

Types

type BoundedLineBuf added in v0.6.17

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

BoundedLineBuf is a io.Writer-compatible object that absorbs written bytes and truncates each line in its buffer to the specified max line length when FlushTo is called

func NewBoundedLineBuf added in v0.6.17

func NewBoundedLineBuf(buf []byte, lineLen int) *BoundedLineBuf

NewBoundedLineBuf constructs a new BoundedLineBuf

func (*BoundedLineBuf) FlushTo added in v0.6.17

func (blb *BoundedLineBuf) FlushTo(w io.Writer) (int, error)

FlushTo flushes the buffer to a target io.Writer

func (*BoundedLineBuf) Write added in v0.6.17

func (blb *BoundedLineBuf) Write(p []byte) (int, error)

Write satisfies io.Writer for BoundedLineBuf

Jump to

Keyboard shortcuts

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