-
Notifications
You must be signed in to change notification settings - Fork 66
Expand file tree
/
Copy pathifaces.go
More file actions
32 lines (27 loc) · 882 Bytes
/
ifaces.go
File metadata and controls
32 lines (27 loc) · 882 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
// 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
}