Documentation ¶
Index ¶
- Constants
- func ComparePropertyReferences(left PropertyReference, right PropertyReference) int
- type Declaration
- type DeclarationType
- type Enum
- type EnumValue
- type Markers
- type Object
- func (o *Object) Description() []string
- func (o *Object) Embed(name string) (*Property, bool)
- func (o *Object) Embeds() []*Property
- func (o *Object) Kind() DeclarationType
- func (o *Object) Properties() []*Property
- func (o *Object) Property(name string) (*Property, bool)
- func (o *Object) SetUsage(uses []PropertyReference)
- func (o *Object) Usage() []PropertyReference
- type Order
- type Package
- func (p *Package) Declaration(name string) (Declaration, bool)
- func (p *Package) Declarations(order Order) []Declaration
- func (p *Package) Group() string
- func (p *Package) Module() string
- func (p *Package) Name() string
- func (p *Package) Object(name string) (*Object, bool)
- func (p *Package) Version() string
- type PackageMetadata
- type Property
- type PropertyContainer
- type PropertyReference
- type Resource
- type TypeReference
Constants ¶
const ( ResourceDeclaration = DeclarationType("Resource") ObjectDeclaration = DeclarationType("Object") EnumDeclaration = DeclarationType("Enum") )
const (
OrderAlphabetical = "alphabetical"
)
Variables ¶
This section is empty.
Functions ¶
func ComparePropertyReferences ¶
func ComparePropertyReferences( left PropertyReference, right PropertyReference, ) int
Types ¶
type Declaration ¶
type Declaration interface { Name() string Id() string Kind() DeclarationType Usage() []PropertyReference SetUsage([]PropertyReference) Description() []string }
Declaration is a common interface for declarations found in Go files
type DeclarationType ¶
type DeclarationType string
type Enum ¶
type Enum struct { TypeReference // contains filtered or unexported fields }
func (*Enum) Description ¶
func (*Enum) Kind ¶
func (e *Enum) Kind() DeclarationType
func (*Enum) SetUsage ¶
func (e *Enum) SetUsage(usage []PropertyReference)
func (*Enum) Usage ¶
func (e *Enum) Usage() []PropertyReference
type EnumValue ¶
type EnumValue struct {
// contains filtered or unexported fields
}
func (*EnumValue) Description ¶
type Markers ¶
type Markers struct {
// contains filtered or unexported fields
}
func NewMarkers ¶
func NewMarkers() *Markers
func ParseComments ¶
ParseComments iterates over the comments and returns the description and any commands that are not part of the description
type Object ¶
type Object struct { TypeReference // contains filtered or unexported fields }
func (*Object) Description ¶
func (*Object) Embed ¶
Embed returns the embed with the given name and true, or nil and false if not found
func (*Object) Kind ¶
func (o *Object) Kind() DeclarationType
func (*Object) Properties ¶
Properties returns all the properties of the object, in alphabetical order
func (*Object) Property ¶
Property returns the property with the given name and true, or nil and false if not found
func (*Object) SetUsage ¶
func (o *Object) SetUsage(uses []PropertyReference)
func (*Object) Usage ¶
func (o *Object) Usage() []PropertyReference
type Package ¶
type Package struct {
// contains filtered or unexported fields
}
Package is a struct containing all of the declarations found in a package directory
func NewPackage ¶
func NewPackage( decl []Declaration, metadata PackageMetadata, cfg *config.Config, log logr.Logger, ) *Package
func (*Package) Declaration ¶
func (p *Package) Declaration(name string) (Declaration, bool)
Declaration returns the declaration with the given name, if found.
func (*Package) Declarations ¶
func (p *Package) Declarations(order Order) []Declaration
type PackageMetadata ¶
type PackageMetadata struct { Name string // Name of this package Module string // Reference to use when importing this package Group string // Controller-Gen Group of this package Version string // Controller-Gen Version of this package }
func (*PackageMetadata) TrySetGroup ¶
func (m *PackageMetadata) TrySetGroup(group string) bool
TrySetGroup will set the group if it is not already set, returning true if successful and false if unchanged
func (*PackageMetadata) TrySetVersion ¶
func (m *PackageMetadata) TrySetVersion(version string) bool
TrySetVersion will set the version if it is not already set, returning true if successful and false if unchanged
type Property ¶
type Property struct { Field string // Name of the field Name string // Serialized name of the field Type TypeReference // contains filtered or unexported fields }
func (*Property) Description ¶
type PropertyContainer ¶
type PropertyContainer interface {
Properties() []*Property
}
type PropertyReference ¶
type PropertyReference struct { HostName string // Name of the container of this property HostId string // Id of the container of this property Property string // Name of the property being referenced }
func NewPropertyReference ¶
func NewPropertyReference( host string, id string, property string, ) PropertyReference
type Resource ¶
func TryNewResource ¶
func (*Resource) Kind ¶
func (r *Resource) Kind() DeclarationType
type TypeReference ¶
type TypeReference struct {
// contains filtered or unexported fields
}
func NewTypeReference ¶
func NewTypeReference(expr dst.Expr) TypeReference
func (*TypeReference) Id ¶
func (ref *TypeReference) Id() string
func (*TypeReference) Name ¶
func (ref *TypeReference) Name() string