gocommon

package module
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Apr 17, 2024 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CollectionOption

type CollectionOption struct {
	Limit              int
	InitializeCapacity int
}

type LocalDate

type LocalDate time.Time

func CurrentLocalDate

func CurrentLocalDate() LocalDate

func NewLocalDate

func NewLocalDate(year int, month time.Month, day int) LocalDate

func ParseIsoDate

func ParseIsoDate(iso string) (LocalDate, error)

func (LocalDate) Equals

func (d LocalDate) Equals(o LocalDate) bool

func (LocalDate) GetDay

func (d LocalDate) GetDay() int

func (LocalDate) GetMonth

func (d LocalDate) GetMonth() time.Month

func (LocalDate) GetYear

func (d LocalDate) GetYear() int

func (LocalDate) IsBefore

func (d LocalDate) IsBefore(o LocalDate) bool

func (LocalDate) MinusDays

func (d LocalDate) MinusDays(days int) LocalDate

func (LocalDate) MinusMonths

func (d LocalDate) MinusMonths(months int) LocalDate

func (LocalDate) PlusDays

func (d LocalDate) PlusDays(days int) LocalDate

func (LocalDate) PlusMonths

func (d LocalDate) PlusMonths(months int) LocalDate

func (LocalDate) PlusYears

func (d LocalDate) PlusYears(years int) LocalDate

func (LocalDate) String

func (d LocalDate) String() String

type OffsetDateTime

type OffsetDateTime time.Time

func CurrentOffsetDateTime

func CurrentOffsetDateTime() OffsetDateTime

func ParseOffsetDateTime

func ParseOffsetDateTime(s string) (OffsetDateTime, error)

func (OffsetDateTime) String

func (t OffsetDateTime) String() string

type Optional

type Optional[T any] struct {
	// contains filtered or unexported fields
}

func Empty

func Empty[T any]() Optional[T]

func With

func With[T any](t T) Optional[T]

func WithPointer

func WithPointer[T any](t *T) Optional[T]

func (Optional[T]) Get

func (op Optional[T]) Get() (T, error)

func (Optional[T]) GetPointer

func (op Optional[T]) GetPointer() (*T, error)

func (Optional[T]) IfPresent

func (op Optional[T]) IfPresent(doSomething func(t T))

func (Optional[T]) IfPresentOrElse

func (op Optional[T]) IfPresentOrElse(doSomething func(t T), orElse func())

func (Optional[T]) IsEmpty

func (op Optional[T]) IsEmpty() bool

func (Optional[T]) IsPresent

func (op Optional[T]) IsPresent() bool

func (Optional[T]) OrElse

func (op Optional[T]) OrElse(t T) *T

func (Optional[T]) OrElseValue

func (op Optional[T]) OrElseValue(t T) T

type String

type String string

func (String) Contains

func (s String) Contains(sub string) bool

func (String) Format

func (s String) Format(args ...any) String

func (String) Index

func (s String) Index(keyword string) int

func (String) IsEmpty

func (s String) IsEmpty() bool

func (String) Length

func (s String) Length() int

func (String) Replace

func (s String) Replace(oldStr string, newStr string) String

Replace all instances of old substring with new value. Return new String

func (String) Split

func (s String) Split(keyword string) []String

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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