util

package
v0.0.0-...-2561dba Latest Latest
Warning

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

Go to latest
Published: Dec 15, 2024 License: GPL-3.0 Imports: 1 Imported by: 0

Documentation

Overview

Package util handles metadata for documentation generation.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func RegisterFunction

func RegisterFunction(name string, metadata *Metadata) error

RegisterFunction records the metadata for a function of this name.

func RegisterResource

func RegisterResource(kind string, metadata *Metadata) error

RegisterResource records the metadata for a resource of this kind.

Types

type Metadata

type Metadata struct {
	// Filename is the filename (without any base dir path) that this is in.
	Filename string

	// Typename is the string name of the main resource struct or function.
	Typename string
}

Metadata stores some additional information about the function or resource. This is used to automatically generate documentation.

func LookupFunction

func LookupFunction(name string) (*Metadata, error)

LookupFunction looks up the metadata for a function of this name.

func LookupResource

func LookupResource(kind string) (*Metadata, error)

LookupResource looks up the metadata for a resource of this kind.

func (*Metadata) GetMetadata

func (obj *Metadata) GetMetadata() *Metadata

GetMetadata returns some metadata about the func. It can be called at any time. This must not be named the same as the struct it's on or using it as an anonymous embedded struct will stop us from being able to call this method.

Jump to

Keyboard shortcuts

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