Fix typos

This commit is contained in:
Fabian Reinartz 2015-05-28 03:12:42 +02:00
parent 67e77411ba
commit ed6572fc0c

View File

@ -106,7 +106,7 @@ func (c Config) String() string {
return string(b) return string(b)
} }
// UnmarshalYAML implements the yaml.Unmarshaller interface. // UnmarshalYAML implements the yaml.Unmarshaler interface.
func (c *Config) UnmarshalYAML(unmarshal func(interface{}) error) error { func (c *Config) UnmarshalYAML(unmarshal func(interface{}) error) error {
c.DefaultedConfig = DefaultConfig c.DefaultedConfig = DefaultConfig
if err := unmarshal(&c.DefaultedConfig); err != nil { if err := unmarshal(&c.DefaultedConfig); err != nil {
@ -144,7 +144,7 @@ type GlobalConfig struct {
DefaultedGlobalConfig `yaml:",inline"` DefaultedGlobalConfig `yaml:",inline"`
} }
// UnmarshalYAML implements the yaml.Unmarshaller interface. // UnmarshalYAML implements the yaml.Unmarshaler interface.
func (c *GlobalConfig) UnmarshalYAML(unmarshal func(interface{}) error) error { func (c *GlobalConfig) UnmarshalYAML(unmarshal func(interface{}) error) error {
c.DefaultedGlobalConfig = DefaultGlobalConfig c.DefaultedGlobalConfig = DefaultGlobalConfig
if err := unmarshal(&c.DefaultedGlobalConfig); err != nil { if err := unmarshal(&c.DefaultedGlobalConfig); err != nil {
@ -172,7 +172,7 @@ type ScrapeConfig struct {
DefaultedScrapeConfig `yaml:",inline"` DefaultedScrapeConfig `yaml:",inline"`
} }
// UnmarshalYAML implements the yaml.Unmarshaller interface. // UnmarshalYAML implements the yaml.Unmarshaler interface.
func (c *ScrapeConfig) UnmarshalYAML(unmarshal func(interface{}) error) error { func (c *ScrapeConfig) UnmarshalYAML(unmarshal func(interface{}) error) error {
c.DefaultedScrapeConfig = DefaultScrapeConfig c.DefaultedScrapeConfig = DefaultScrapeConfig
err := unmarshal(&c.DefaultedScrapeConfig) err := unmarshal(&c.DefaultedScrapeConfig)
@ -234,7 +234,7 @@ func (tg TargetGroup) String() string {
return tg.Source return tg.Source
} }
// UnmarshalYAML implements the yaml.Unmarshaller interface. // UnmarshalYAML implements the yaml.Unmarshaler interface.
func (tg *TargetGroup) UnmarshalYAML(unmarshal func(interface{}) error) error { func (tg *TargetGroup) UnmarshalYAML(unmarshal func(interface{}) error) error {
g := struct { g := struct {
Targets []string `yaml:"targets"` Targets []string `yaml:"targets"`
@ -256,7 +256,7 @@ func (tg *TargetGroup) UnmarshalYAML(unmarshal func(interface{}) error) error {
return nil return nil
} }
// MarshalYAML implements the yaml.Marshaller interface. // MarshalYAML implements the yaml.Marshaler interface.
func (tg TargetGroup) MarshalYAML() (interface{}, error) { func (tg TargetGroup) MarshalYAML() (interface{}, error) {
g := &struct { g := &struct {
Targets []string `yaml:"targets"` Targets []string `yaml:"targets"`
@ -271,7 +271,7 @@ func (tg TargetGroup) MarshalYAML() (interface{}, error) {
return g, nil return g, nil
} }
// UnmarshalJSON implements the json.Unmarshaller interface. // UnmarshalJSON implements the json.Unmarshaler interface.
func (tg *TargetGroup) UnmarshalJSON(b []byte) error { func (tg *TargetGroup) UnmarshalJSON(b []byte) error {
g := struct { g := struct {
Targets []string `yaml:"targets"` Targets []string `yaml:"targets"`
@ -299,7 +299,7 @@ type DNSSDConfig struct {
DefaultedDNSSDConfig `yaml:",inline"` DefaultedDNSSDConfig `yaml:",inline"`
} }
// UnmarshalYAML implements the yaml.Unmarshaller interface. // UnmarshalYAML implements the yaml.Unmarshaler interface.
func (c *DNSSDConfig) UnmarshalYAML(unmarshal func(interface{}) error) error { func (c *DNSSDConfig) UnmarshalYAML(unmarshal func(interface{}) error) error {
c.DefaultedDNSSDConfig = DefaultDNSSDConfig c.DefaultedDNSSDConfig = DefaultDNSSDConfig
err := unmarshal(&c.DefaultedDNSSDConfig) err := unmarshal(&c.DefaultedDNSSDConfig)
@ -324,7 +324,7 @@ type FileSDConfig struct {
DefaultedFileSDConfig `yaml:",inline"` DefaultedFileSDConfig `yaml:",inline"`
} }
// UnmarshalYAML implements the yaml.Unmarshaller interface. // UnmarshalYAML implements the yaml.Unmarshaler interface.
func (c *FileSDConfig) UnmarshalYAML(unmarshal func(interface{}) error) error { func (c *FileSDConfig) UnmarshalYAML(unmarshal func(interface{}) error) error {
c.DefaultedFileSDConfig = DefaultFileSDConfig c.DefaultedFileSDConfig = DefaultFileSDConfig
err := unmarshal(&c.DefaultedFileSDConfig) err := unmarshal(&c.DefaultedFileSDConfig)
@ -354,7 +354,7 @@ type ConsulSDConfig struct {
DefaultedConsulSDConfig `yaml:",inline"` DefaultedConsulSDConfig `yaml:",inline"`
} }
// UnmarshalYAML implements the yaml.Unmarshaller interface. // UnmarshalYAML implements the yaml.Unmarshaler interface.
func (c *ConsulSDConfig) UnmarshalYAML(unmarshal func(interface{}) error) error { func (c *ConsulSDConfig) UnmarshalYAML(unmarshal func(interface{}) error) error {
c.DefaultedConsulSDConfig = DefaultConsulSDConfig c.DefaultedConsulSDConfig = DefaultConsulSDConfig
err := unmarshal(&c.DefaultedConsulSDConfig) err := unmarshal(&c.DefaultedConsulSDConfig)
@ -394,7 +394,7 @@ const (
RelabelDrop = "drop" RelabelDrop = "drop"
) )
// UnmarshalYAML implements the yaml.Unmarshaller interface. // UnmarshalYAML implements the yaml.Unmarshaler interface.
func (a *RelabelAction) UnmarshalYAML(unmarshal func(interface{}) error) error { func (a *RelabelAction) UnmarshalYAML(unmarshal func(interface{}) error) error {
var s string var s string
if err := unmarshal(&s); err != nil { if err := unmarshal(&s); err != nil {
@ -414,7 +414,7 @@ type RelabelConfig struct {
DefaultedRelabelConfig `yaml:",inline"` DefaultedRelabelConfig `yaml:",inline"`
} }
// UnmarshalYAML implements the yaml.Unmarshaller interface. // UnmarshalYAML implements the yaml.Unmarshaler interface.
func (c *RelabelConfig) UnmarshalYAML(unmarshal func(interface{}) error) error { func (c *RelabelConfig) UnmarshalYAML(unmarshal func(interface{}) error) error {
c.DefaultedRelabelConfig = DefaultRelabelConfig c.DefaultedRelabelConfig = DefaultRelabelConfig
return unmarshal(&c.DefaultedRelabelConfig) return unmarshal(&c.DefaultedRelabelConfig)
@ -442,7 +442,7 @@ type Regexp struct {
regexp.Regexp regexp.Regexp
} }
// UnmarshalYAML implements the yaml.Unmarshaller interface. // UnmarshalYAML implements the yaml.Unmarshaler interface.
func (re *Regexp) UnmarshalYAML(unmarshal func(interface{}) error) error { func (re *Regexp) UnmarshalYAML(unmarshal func(interface{}) error) error {
var s string var s string
if err := unmarshal(&s); err != nil { if err := unmarshal(&s); err != nil {
@ -456,7 +456,7 @@ func (re *Regexp) UnmarshalYAML(unmarshal func(interface{}) error) error {
return nil return nil
} }
// MarshalYAML implements the yaml.Marshaller interface. // MarshalYAML implements the yaml.Marshaler interface.
func (re Regexp) MarshalYAML() (interface{}, error) { func (re Regexp) MarshalYAML() (interface{}, error) {
return re.String(), nil return re.String(), nil
} }
@ -467,7 +467,7 @@ func (re Regexp) MarshalYAML() (interface{}, error) {
// we might want to move this into our model as well, eventually. // we might want to move this into our model as well, eventually.
type Duration time.Duration type Duration time.Duration
// UnmarshalYAML implements the yaml.Unmarshaller interface. // UnmarshalYAML implements the yaml.Unmarshaler interface.
func (d *Duration) UnmarshalYAML(unmarshal func(interface{}) error) error { func (d *Duration) UnmarshalYAML(unmarshal func(interface{}) error) error {
var s string var s string
if err := unmarshal(&s); err != nil { if err := unmarshal(&s); err != nil {
@ -481,7 +481,7 @@ func (d *Duration) UnmarshalYAML(unmarshal func(interface{}) error) error {
return nil return nil
} }
// MarshalYAML implements the yaml.Marshaller interface. // MarshalYAML implements the yaml.Marshaler interface.
func (d Duration) MarshalYAML() (interface{}, error) { func (d Duration) MarshalYAML() (interface{}, error) {
return utility.DurationToString(time.Duration(d)), nil return utility.DurationToString(time.Duration(d)), nil
} }