ratchet

package
v0.0.0-...-e0d470e Latest Latest
Warning

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

Go to latest
Published: Aug 3, 2023 License: AGPL-3.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func FormatCUEKey

func FormatCUEKey(keyID string, key gjson.Result) (string, error)

FormatCUEKey returns the translated string from gjson.Result to CUE value or returns an error if the key is neither required nor optional.

func Main

func Main() int

Types

type Ratchet

type Ratchet struct {
	Debug           io.Writer
	Output          []string
	ProviderAddress string
	ProviderSchema  string
}

Ratchet stores the CLI runtime information

func New

func New(providerSchemaPath, providerAddress string) (*Ratchet, error)

New creates a new Ratchet instance with the provided provider schema data and address.

func (*Ratchet) ConvertType

func (rt *Ratchet) ConvertType(attributeType gjson.Result)

func (*Ratchet) EmitAttribute

func (rt *Ratchet) EmitAttribute(attributeID string, attributeValue gjson.Result)

func (*Ratchet) EmitBlockAttributes

func (rt *Ratchet) EmitBlockAttributes(attributes gjson.Result)

func (*Ratchet) EmitDataSource

func (rt *Ratchet) EmitDataSource(attributes gjson.Result)

func (*Ratchet) EmitEntities

func (rt *Ratchet) EmitEntities()

EmitEntities generates and emits entities for data sources and resources based on the Ratchet's provider schema.

func (*Ratchet) EmitNestedAttribute

func (rt *Ratchet) EmitNestedAttribute(attributeID string, attributeValue gjson.Result)

func (*Ratchet) EmitNestedAttributes

func (rt *Ratchet) EmitNestedAttributes(attributes gjson.Result)

func (*Ratchet) EmitResource

func (rt *Ratchet) EmitResource(attributes gjson.Result)

func (*Ratchet) EmitSingleAttributes

func (rt *Ratchet) EmitSingleAttributes(attributes gjson.Result)

func (*Ratchet) ProviderData

func (rt *Ratchet) ProviderData(providerSchemaPath string) error

ProviderData stores the data of the provider associated with the Ratchet instance as a slice of bytes.

func (*Ratchet) String

func (rt *Ratchet) String() string

String returns the string representation of Ratchet instance.

Directories

Path Synopsis
cmd

Jump to

Keyboard shortcuts

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