metadata

package
v0.0.0-...-94cd6a6 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 17, 2025 License: Apache-2.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CommandMetadata

type CommandMetadata struct {
	ClassName        string
	SimpleName       string
	Description      string
	Parameters       []ParameterMetadata
	ResponseName     string
	Category         string // E.g., "vpc", "vm", "network"
	HasAdminVariant  bool   // Whether this command has an admin variant
	AdminVariantName string // The name of the admin variant command, if any
	IsAsync          bool   // Whether this command is asynchronous
}

CommandMetadata represents the metadata for a CloudStack API command

type EnumMetadata

type EnumMetadata struct {
	ClassName   string
	SimpleName  string
	PackageName string
	IsNested    bool
	ParentClass string
	Values      []EnumValueMetadata
}

EnumMetadata represents the metadata for a CloudStack API enum

type EnumValueMetadata

type EnumValueMetadata struct {
	Name    string
	Ordinal int
	Extras  map[string]interface{}
}

EnumValueMetadata represents a value in a CloudStack API enum

type Metadata

type Metadata struct {
	Commands   map[string]CommandMetadata
	Responses  map[string]ResponseMetadata
	Enums      map[string]EnumMetadata
	Categories map[string][]string // Maps category (e.g., "vpc") to command names
}

Metadata represents the parsed CloudStack API metadata

func ParseMetadata

func ParseMetadata(metadataDir string) (*Metadata, error)

ParseMetadata parses the CloudStack API metadata from the given directory

type ParameterMetadata

type ParameterMetadata struct {
	Name        string
	FieldName   string
	JavaType    string
	Description string
	Required    bool
	Since       string
}

ParameterMetadata represents a parameter in a CloudStack API command

type ProtoGenerator

type ProtoGenerator struct {
	Metadata *Metadata
	RootDir  string
	// contains filtered or unexported fields
}

ProtoGenerator generates protobuf definitions from CloudStack API metadata

func NewProtoGenerator

func NewProtoGenerator(metadata *Metadata, rootDir string, format bool) *ProtoGenerator

NewProtoGenerator creates a new protobuf generator

func (*ProtoGenerator) GenerateProto

func (g *ProtoGenerator) GenerateProto() error

GenerateProto generates protobuf files for each API category

type ResponseFieldMetadata

type ResponseFieldMetadata struct {
	Name           string
	FieldName      string
	JavaType       string
	Description    string
	Since          string
	ResponseObject string // Type of response object for this field
	IsDisplay      bool   // Whether this field is for display purposes
}

ResponseFieldMetadata contains metadata for a field in a CloudStack API response

type ResponseMetadata

type ResponseMetadata struct {
	ClassName       string
	SimpleName      string
	Description     string
	Fields          []ResponseFieldMetadata
	IsListResponse  bool   // Whether this is a list response
	ListElementTag  string // XML tag for list elements (e.g., "virtualmachine")
	ListElementName string // Name of the list element if specified explicitly
	ItemTypeName    string // Derived item type name for list responses
	ObjectName      string // The underlying object name
}

ResponseMetadata represents the metadata for a CloudStack API response

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL