helpers

package
v0.2.10 Latest Latest
Warning

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

Go to latest
Published: Sep 10, 2023 License: MIT Imports: 3 Imported by: 3

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func FillStructFromKV added in v0.1.9

func FillStructFromKV(kv map[string]string, v interface{}) error

func MergeChannels

func MergeChannels[A any](channels ...<-chan A) <-chan A

func ParseKV added in v0.1.9

func ParseKV(s string) map[string]string

ParseKV transforms a simple format. Each line has a key value pair separated by :. Empty lines are ignored

Types

type Nothing

type Nothing struct{}

type Result

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

func NewErrorResult

func NewErrorResult[T any](err error) Result[T]

func NewPartialResult added in v0.1.18

func NewPartialResult[T any](value T) Result[T]

func NewResult

func NewResult[T any](value T, err error) Result[T]

func NewValueResult

func NewValueResult[T any](value T) Result[T]

func (Result[T]) Error added in v0.1.18

func (r Result[T]) Error() error

func (Result[T]) IsPartial added in v0.1.18

func (r Result[T]) IsPartial() bool

func (Result[T]) Ok

func (r Result[T]) Ok() bool

func (Result[T]) Unwrap

func (r Result[T]) Unwrap() T

func (Result[T]) Value

func (r Result[T]) Value() (T, error)

func (Result[T]) ValueOr

func (r Result[T]) ValueOr(v T) T

Jump to

Keyboard shortcuts

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