You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
boundary/api/hosts/static_host_catalog.go

34 lines
725 B

// Code generated by go generate; DO NOT EDIT.
// This file was generated by robots at
// 2020-05-03 13:43:08.1258801 -0400 EDT m=+0.031889201
package hosts
import (
"fmt"
"github.com/mitchellh/mapstructure"
)
type StaticHostCatalog struct {
*HostCatalog
}
func (s HostCatalog) AsStaticHostCatalog() (*StaticHostCatalog, error) {
out := &StaticHostCatalog{
HostCatalog: &s,
}
decoder, err := mapstructure.NewDecoder(&mapstructure.DecoderConfig{
Result: out,
TagName: "json",
})
if err != nil {
return nil, fmt.Errorf("error creating map decoder: %w", err)
}
if err := decoder.Decode(s.Attributes); err != nil {
return nil, fmt.Errorf("error decoding attributes map: %w", err)
}
return out, nil
}