gokit

package module
v1.5.3 Latest Latest
Warning

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

Go to latest
Published: Aug 10, 2024 License: MIT Imports: 17 Imported by: 0

README

GoKit

The awesome GoKit library for Golang, aims to bring developer friendliness to just about every project.

Go Report Card Test Status MIT license Go.Dev reference

Documentation

Index

Constants

This section is empty.

Variables

View Source
var IO xIO
View Source
var Net xNet
View Source
var Path xPath

Functions

func In added in v1.5.3

func In[T comparable](value T, entries ...T) bool

func Join

func Join(delim string, entries ...any) string

func JoinFunc added in v1.5.2

func JoinFunc(delim string, entries []any, callbacks ...JoinEntryFunc) string

func New

func New[T any]() (value T)

func Ptr

func Ptr(v any) any

func PtrOf

func PtrOf[T any](v T) *T

func Split

func Split[T SetConstraint](data string, delim string) (value []T, err error)

func Write

func Write(input any, output any) (err error)

func Zero

func Zero[T any]() (value T)

Types

type Array

type Array[T comparable] struct {
	// contains filtered or unexported fields
}

func (*Array[T]) Append

func (x *Array[T]) Append(entries ...T)

func (*Array[T]) Clear

func (x *Array[T]) Clear()

func (*Array[T]) Contains

func (x *Array[T]) Contains(v T) bool

func (*Array[T]) Filter

func (x *Array[T]) Filter(callback ArrayPredicate[T]) (value *Array[T])

func (*Array[T]) ForEach

func (x *Array[T]) ForEach(callback ArrayCallback[T])

func (*Array[T]) IndexOf

func (x *Array[T]) IndexOf(v T) int

func (*Array[T]) LastIndexOf

func (x *Array[T]) LastIndexOf(v T) int

func (*Array[T]) Len

func (x *Array[T]) Len() int

func (*Array[T]) Prepend

func (x *Array[T]) Prepend(entries ...T)

func (*Array[T]) TakeAt

func (x *Array[T]) TakeAt(i int) T

func (*Array[T]) TakeFirst

func (x *Array[T]) TakeFirst() T

func (*Array[T]) TakeLast

func (x *Array[T]) TakeLast() T

type ArrayCallback

type ArrayCallback[T comparable] func(entry T, i int)

type ArrayPredicate

type ArrayPredicate[T comparable] func(entry T, i int) bool

type CYBReaderLike

type CYBReaderLike interface {
	ReadBytes(delim byte) ([]byte, error)
	ReadLine() (b []byte, err error)
	ReadString(delim byte) (s string, err error)
	ReadStringLine() (s string, err error)
}

type IOData

type IOData[T any] struct {
	Error error
	Data  T
}

type JoinEntryFunc added in v1.5.2

type JoinEntryFunc func(v string) string

type Mutex

type Mutex[T comparable] struct {
	// contains filtered or unexported fields
}

func (*Mutex[T]) Lock

func (x *Mutex[T]) Lock(key T)

func (*Mutex[T]) Unlock

func (x *Mutex[T]) Unlock(key T)

type PathFn

type PathFn func() (path string, err error)

type SetConstraint

type SetConstraint interface {
	constraints.Integer | constraints.Float | ~string
}

type Validator

type Validator interface {
	Validate(data any, rules ...any) (err error)
}

func NewValidator

func NewValidator(tagName ...string) Validator

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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