common

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Mar 24, 2022 License: Apache-2.0 Imports: 3 Imported by: 15

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type JSONRef

type JSONRef struct {
	// Ref is the JSON reference. That's the only thing that is used during the marshalling / unmarshalling process.
	// Other attributes are ignored during these processes.
	Ref string `json:"$ref" yaml:"$ref"`
	// Path is a list of string that will be used to find from the root of the struct the object pointed.
	Path []string `json:"-" yaml:"-"`
	// Object will contain the pointer to the actual object referenced by Ref
	Object interface{} `json:"-" yaml:"-"`
}

func (*JSONRef) UnmarshalJSON

func (j *JSONRef) UnmarshalJSON(data []byte) error

func (*JSONRef) UnmarshalYAML

func (j *JSONRef) UnmarshalYAML(unmarshal func(interface{}) error) error

type Regexp

type Regexp struct {
	*regexp.Regexp
	// contains filtered or unexported fields
}

Regexp encapsulates a regexp.Regexp and makes it JSON/YAML marshalable.

func MustNewRegexp

func MustNewRegexp(s string) Regexp

MustNewRegexp works like NewRegexp, but panics if the regular expression does not compile.

func NewRegexp

func NewRegexp(s string) (Regexp, error)

NewRegexp creates a new anchored Regexp and returns an error if the passed-in regular expression does not compile.

func (Regexp) MarshalJSON

func (re Regexp) MarshalJSON() ([]byte, error)

func (Regexp) MarshalYAML

func (re Regexp) MarshalYAML() (interface{}, error)

func (*Regexp) UnmarshalJSON

func (re *Regexp) UnmarshalJSON(data []byte) error

func (*Regexp) UnmarshalYAML

func (re *Regexp) UnmarshalYAML(unmarshal func(interface{}) error) error

Jump to

Keyboard shortcuts

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