cuf

package
v0.9.0 Latest Latest
Warning

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

Go to latest
Published: Apr 25, 2024 License: BSD-3-Clause Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func IsValid

func IsValid(cUF CUF) bool

IsValid returns whether the provided cUF is valid or not

Types

type CUF

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

CUF stands for "Código da Unidade Federativa"

func MustNew

func MustNew(uf string) CUF

MustNew returns CUF if the given cUF is valid or panic

func New

func New(uf string) (CUF, error)

New validate and returns either (CUF, nil) if the given cUF is valid or (empty CUF, error).

func (CUF) MarshalJSON

func (c CUF) MarshalJSON() ([]byte, error)

MarshalJSON serializes the CUF value as a JSON value

func (CUF) MarshalZerologObject

func (c CUF) MarshalZerologObject(e *zerolog.Event)

MarshalZerologObject implements the zerolog marshaler so it can be logged using: log.With().EmbededObject(cuf).Msg("Some message")

func (CUF) String

func (c CUF) String() string

func (*CUF) UnmarshalJSON

func (c *CUF) UnmarshalJSON(b []byte) error

UnmarshalJSON deserialize a JSON value into a CUF value

Jump to

Keyboard shortcuts

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