Files
Sebastiaan van Stijn 9e26694618 vendor: github.com/moby/policy-helpers b7c0b994300b
full diff: 824747bfdd...b7c0b99430

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2026-03-26 17:03:33 +01:00

33 lines
882 B
Go

// SPDX-FileCopyrightText: Copyright 2015-2025 go-swagger maintainers
// SPDX-License-Identifier: Apache-2.0
package strfmt
import (
"encoding"
"reflect"
"github.com/go-viper/mapstructure/v2"
)
// Format represents a string format.
//
// All implementations of Format provide a string representation and text
// marshaling/unmarshaling interface to be used by encoders (e.g. encoding/[json]).
type Format interface {
String() string
encoding.TextMarshaler
encoding.TextUnmarshaler
}
// Registry is a registry of string formats, with a validation method.
type Registry interface {
Add(name string, strfmt Format, validator Validator) bool
DelByName(name string) bool
GetType(name string) (reflect.Type, bool)
ContainsName(name string) bool
Validates(name, data string) bool
Parse(name, data string) (any, error)
MapStructureHookFunc() mapstructure.DecodeHookFunc
}