internal/openapi/responder/serializer/Serializer.go   A
last analyzed

Size/Duplication

Total Lines 12
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
cc 1
eloc 9
dl 0
loc 12
ccs 1
cts 1
cp 1
crap 1
rs 10
c 0
b 0
f 0

1 Method

Rating   Name   Duplication   Size   Complexity  
A serializer.New 0 6 1
1
package serializer
2
3
type Serializer interface {
4
	Serialize(data interface{}, format string) ([]byte, error)
5
}
6
7
func New() Serializer {
8 1
	return &coordinatingSerializer{
9
		formatSerializers: map[string]Serializer{
10
			"raw":  &rawSerializer{},
11
			"json": &jsonSerializer{},
12
			"xml":  &xmlSerializer{rootTag: "root"},
13
		},
14
	}
15
}
16