dmeta

package
v0.0.0-...-d49a382 Latest Latest
Warning

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

Go to latest
Published: Dec 8, 2020 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Bytable

type Bytable interface {
	ToJSONBytes() []byte

	// AppendBytes appends the JSON value of this type to the given writer.
	//
	// This method should include any encapsulating characters such as quotes or
	// brackets.  JSON field dividers separating this value from other values,
	// such as commas or colons should be appended by the caller of this method,
	// not the implementer.  Implementers of this method should only include those
	// dividers multiple values are encapsulated in this type itself, such as in a
	// struct or slice type.
	//
	// Example:
	//   Given a field of type `string`, with the value:
	//     foo := "hello"
	//   The bytes that should be written would be:
	//     []byte(`"hello"`).
	//
	//   Given a field of type `[]string` with the value
	//     foo := []string{"yes", "no"}
	//   The bytes that would be written would be:
	//     []byte(`["yes","no"]`)
	AppendJSONBytes(writer io.Writer) error
}

type Field

type Field interface {
	json.Marshaler
	json.Unmarshaler

	Sized
	Nillable
	Bytable
}

type Nillable

type Nillable interface {
	IsNil() bool
}

type Sized

type Sized interface {
	// JSONSize returns the projected number of bytes required to store this value
	// as a JSON string.
	JSONSize() uint32
}

type Validatable

type Validatable interface {
	IsValid() bool
	Validate() error
}

Jump to

Keyboard shortcuts

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