optional

package
v0.9.15 Latest Latest
Warning

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

Go to latest
Published: Mar 3, 2021 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Overview

Package optional provides container objects which may or may not contain a non-null value.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Duration

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

Duration in a container objects which may or may not contain an Duration.

func NewDuration

func NewDuration(s time.Duration) *Duration

NewDuration creates optional.Duration from Duration.

func NewDurationFromString

func NewDurationFromString(s string) (*Duration, error)

NewDurationFromString creates optional.Duration from string.

func (*Duration) Get

func (s *Duration) Get() time.Duration

Get returns the value in the contains.

func (*Duration) IsPresent

func (s *Duration) IsPresent() bool

IsPresent returns if the object contains an Duration.

type Int

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

Int in a container objects which may or may not contain an int.

func NewInt

func NewInt(i int) *Int

NewInt creates optional.Int from int.

func NewIntFromString

func NewIntFromString(s string) (*Int, error)

NewIntFromString creates optional.Int from string.

func (*Int) Get

func (s *Int) Get() int

Get returns the value in the contains.

func (*Int) IsPresent

func (s *Int) IsPresent() bool

IsPresent returns if the object contains an int.

Jump to

Keyboard shortcuts

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