hcl

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Mar 26, 2023 License: MPL-2.0 Imports: 10 Imported by: 0

Documentation

Overview

package hcl - implements the HCL related functionality. Input parsing, input error handling.

Index

Constants

This section is empty.

Variables

Functions

func ParseHCL

func ParseHCL(w io.Writer, data []byte, filename string) (*hclparse.Parser, *hcl.File, error)

func ParseHCLFile

func ParseHCLFile(w io.Writer, filename string) (*hclparse.Parser, *hcl.File, error)

Types

type Connector

type Connector struct {
	Label string `hcl:"label,optional"`
	From  string `hcl:"from"`
	To    string `hcl:"to"`
	Color string `hcl:"color,optional"`
	Type  string `hcl:"type,optional"`
}

Connector -

func (*Connector) String added in v0.3.0

func (c *Connector) String() string

type Map

type Map struct {
	Size       *Size        `hcl:"size,block"`
	Nodes      []*Node      `hcl:"node,block"`
	Connectors []*Connector `hcl:"connector,block"`
}

Map -

func DecodeMap

func DecodeMap(w io.Writer, parser *hclparse.Parser, f *hcl.File) (*Map, error)

type Node

type Node struct {
	ID          string `hcl:"id,label"`
	Label       string `hcl:"label"`
	Description string `hcl:"description,optional"`
	X           int
	Y           int
	Visibility  int    `hcl:"visibility" cty:"visibility"`
	Evolution   string `hcl:"evolution"`
	EvolutionX  int    `hcl:"x" cty:"x"`
	Fill        string `hcl:"fill,optional"`
	Color       string `hcl:"color,optional"`
}

Node -

func (*Node) String added in v0.3.0

func (n *Node) String() string

type Size

type Size struct {
	Width    int `hcl:"width,optional"`
	Height   int `hcl:"height,optional"`
	Margin   int `hcl:"margin,optional"`
	FontSize int `hcl:"font_size,optional"`
}

func (*Size) String added in v0.3.0

func (s *Size) String() string

Jump to

Keyboard shortcuts

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