-
Notifications
You must be signed in to change notification settings - Fork 0
/
section.go
32 lines (26 loc) · 893 Bytes
/
section.go
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
package astconf
// SectionNamer provides the section name for a type.
type SectionNamer interface {
SectionName() string
}
// SectionName is a simple implementation of SectionNamer. Its value won't
// be written as a setting.
type SectionName string
// SectionName returns s as the name for the section.
func (s SectionName) SectionName() string {
return string(s)
}
// MarshalAsterisk prevents the section name from being marshaled.
func (s SectionName) MarshalAsterisk(e *Encoder) error {
return nil
}
// SectionTemplater provides section templates for a type. It must be provided
// by the same type that provides the name for a section.
type SectionTemplater interface {
SectionTemplates() []string
}
/*
// Section identifies a well-known section properties when embedded in a type.
// The section name to be used is derived from its tag by the encoder.
type Section struct{}
*/