properties

package
v7.0.0-alpha.1 Latest Latest
Warning

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

Go to latest
Published: Nov 7, 2023 License: BSD-3-Clause Imports: 8 Imported by: 0

Documentation

Index

Constants

View Source
const CUSTOM_STRING_PROPERTY string = "string"

Variables

This section is empty.

Functions

func EnsureCustomPropertyHasValue

func EnsureCustomPropertyHasValue(ctx context.Context, pr CustomProperty, body []byte) (bool, error)

func RegisterCustomProperty

func RegisterCustomProperty(ctx context.Context, scheme string, init_func CustomPropertyInitializationFunc) error

RegisterCustom registers 'scheme' as a key pointing to 'init_func' in an internal lookup table used to create new `CustomProperty` instances by the `NewCustom` method.

func Schemes

func Schemes() []string

Schemes returns the list of schemes that have been registered.

Types

type CustomProperty

type CustomProperty interface {
	Name() string
	Type() string
	Required() bool
	CustomElement() string
}

func NewCustomProperty

func NewCustomProperty(ctx context.Context, uri string) (CustomProperty, error)

NewCustom returns a new `CustomProperty` instance configured by 'uri'. The value of 'uri' is parsed as a `url.URL` and its scheme is used as the key for a corresponding `CustomInitializationFunc` function used to instantiate the new `Custom`. It is assumed that the scheme (and initialization function) have been registered by the `RegisterCustom` method.

func NewCustomStringProperty

func NewCustomStringProperty(ctx context.Context, uri string) (CustomProperty, error)

type CustomPropertyInitializationFunc

type CustomPropertyInitializationFunc func(ctx context.Context, uri string) (CustomProperty, error)

CustomInitializationFunc is a function defined by individual custom package and used to create an instance of that custom

type CustomStringProperty

type CustomStringProperty struct {
	CustomProperty
	// contains filtered or unexported fields
}

func (*CustomStringProperty) CustomElement

func (pr *CustomStringProperty) CustomElement() string

func (*CustomStringProperty) Name

func (pr *CustomStringProperty) Name() string

func (*CustomStringProperty) Required

func (pr *CustomStringProperty) Required() bool

func (*CustomStringProperty) Type

func (pr *CustomStringProperty) Type() string

Jump to

Keyboard shortcuts

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