layupv1

package
v0.0.0-...-13c06d8 Latest Latest
Warning

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

Go to latest
Published: Jan 4, 2024 License: MPL-2.0 Imports: 27 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var File_layup_v1_layup_proto protoreflect.FileDescriptor

Functions

func WriteD2

func WriteD2(w io.Writer, m *Model) error

WriteD2 writes a D2 (Terrastruct) graph to the given writer using the given Layup model's data.

func WriteDOT

func WriteDOT(w io.Writer, m *Model) error

WriteDOT writes a DOT graph to the given writer using the given Layup model's data.

func WriteMermiad

func WriteMermiad(w io.Writer, m *Model) error

WriteMermiad writes a Mermaid graph to the given writer using the given Layup model's data.

Types

type Layer

type Layer struct {
	Id         string                     `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"`
	Attributes map[string]*structpb.Value `` /* 161-byte string literal not displayed */
	Nodes      []*Node                    `protobuf:"bytes,3,rep,name=nodes,proto3" json:"nodes,omitempty"`
	Links      []*Link                    `protobuf:"bytes,4,rep,name=links,proto3" json:"links,omitempty"`
	Dynamic    *bool                      `protobuf:"varint,5,opt,name=dynamic,proto3,oneof" json:"dynamic,omitempty"`
	// contains filtered or unexported fields
}

A layer is a collection of nodes and links.

func (*Layer) Descriptor deprecated

func (*Layer) Descriptor() ([]byte, []int)

Deprecated: Use Layer.ProtoReflect.Descriptor instead.

func (*Layer) GetAttributes

func (x *Layer) GetAttributes() map[string]*structpb.Value

func (*Layer) GetDynamic

func (x *Layer) GetDynamic() bool

func (*Layer) GetId

func (x *Layer) GetId() string
func (x *Layer) GetLinks() []*Link

func (*Layer) GetNodes

func (x *Layer) GetNodes() []*Node

func (*Layer) ProtoMessage

func (*Layer) ProtoMessage()

func (*Layer) ProtoReflect

func (x *Layer) ProtoReflect() protoreflect.Message

func (*Layer) Reset

func (x *Layer) Reset()

func (*Layer) String

func (x *Layer) String() string

func (*Layer) Validate

func (m *Layer) Validate() error

Validate checks the field values on Layer with the rules defined in the proto definition for this message. If any rules are violated, the first error encountered is returned, or nil if there are no violations.

func (*Layer) ValidateAll

func (m *Layer) ValidateAll() error

ValidateAll checks the field values on Layer with the rules defined in the proto definition for this message. If any rules are violated, the result is a list of violation errors wrapped in LayerMultiError, or nil if none found.

type LayerMultiError

type LayerMultiError []error

LayerMultiError is an error wrapping multiple validation errors returned by Layer.ValidateAll() if the designated constraints aren't met.

func (LayerMultiError) AllErrors

func (m LayerMultiError) AllErrors() []error

AllErrors returns a list of validation violation errors.

func (LayerMultiError) Error

func (m LayerMultiError) Error() string

Error returns a concatenation of all the error messages it wraps.

type LayerValidationError

type LayerValidationError struct {
	// contains filtered or unexported fields
}

LayerValidationError is the validation error returned by Layer.Validate if the designated constraints aren't met.

func (LayerValidationError) Cause

func (e LayerValidationError) Cause() error

Cause function returns cause value.

func (LayerValidationError) Error

func (e LayerValidationError) Error() string

Error satisfies the builtin error interface

func (LayerValidationError) ErrorName

func (e LayerValidationError) ErrorName() string

ErrorName returns error name.

func (LayerValidationError) Field

func (e LayerValidationError) Field() string

Field function returns field value.

func (LayerValidationError) Key

func (e LayerValidationError) Key() bool

Key function returns key value.

func (LayerValidationError) Reason

func (e LayerValidationError) Reason() string

Reason function returns reason value.

type Link struct {
	Id         string                     `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"`
	Attributes map[string]*structpb.Value `` /* 161-byte string literal not displayed */
	From       string                     `protobuf:"bytes,3,opt,name=from,proto3" json:"from,omitempty"`
	To         string                     `protobuf:"bytes,4,opt,name=to,proto3" json:"to,omitempty"`
	// contains filtered or unexported fields
}

A link is a relationship between two nodes.

func (*Link) Descriptor deprecated

func (*Link) Descriptor() ([]byte, []int)

Deprecated: Use Link.ProtoReflect.Descriptor instead.

func (*Link) GetAttributes

func (x *Link) GetAttributes() map[string]*structpb.Value

func (*Link) GetFrom

func (x *Link) GetFrom() string

func (*Link) GetId

func (x *Link) GetId() string

func (*Link) GetTo

func (x *Link) GetTo() string

func (*Link) ProtoMessage

func (*Link) ProtoMessage()

func (*Link) ProtoReflect

func (x *Link) ProtoReflect() protoreflect.Message

func (*Link) Reset

func (x *Link) Reset()

func (*Link) String

func (x *Link) String() string

func (*Link) Validate

func (m *Link) Validate() error

Validate checks the field values on Link with the rules defined in the proto definition for this message. If any rules are violated, the first error encountered is returned, or nil if there are no violations.

func (*Link) ValidateAll

func (m *Link) ValidateAll() error

ValidateAll checks the field values on Link with the rules defined in the proto definition for this message. If any rules are violated, the result is a list of violation errors wrapped in LinkMultiError, or nil if none found.

type LinkMultiError

type LinkMultiError []error

LinkMultiError is an error wrapping multiple validation errors returned by Link.ValidateAll() if the designated constraints aren't met.

func (LinkMultiError) AllErrors

func (m LinkMultiError) AllErrors() []error

AllErrors returns a list of validation violation errors.

func (LinkMultiError) Error

func (m LinkMultiError) Error() string

Error returns a concatenation of all the error messages it wraps.

type LinkValidationError

type LinkValidationError struct {
	// contains filtered or unexported fields
}

LinkValidationError is the validation error returned by Link.Validate if the designated constraints aren't met.

func (LinkValidationError) Cause

func (e LinkValidationError) Cause() error

Cause function returns cause value.

func (LinkValidationError) Error

func (e LinkValidationError) Error() string

Error satisfies the builtin error interface

func (LinkValidationError) ErrorName

func (e LinkValidationError) ErrorName() string

ErrorName returns error name.

func (LinkValidationError) Field

func (e LinkValidationError) Field() string

Field function returns field value.

func (LinkValidationError) Key

func (e LinkValidationError) Key() bool

Key function returns key value.

func (LinkValidationError) Reason

func (e LinkValidationError) Reason() string

Reason function returns reason value.

type Model

type Model struct {
	Uri        string                     `protobuf:"bytes,1,opt,name=uri,proto3" json:"uri,omitempty"`
	Attributes map[string]*structpb.Value `` /* 161-byte string literal not displayed */
	Layers     []*Layer                   `protobuf:"bytes,3,rep,name=layers,proto3" json:"layers,omitempty"`
	// contains filtered or unexported fields
}

A model is a collection of layers which contain nodes and links representing the data in the graph.

func ParseHCL

func ParseHCL(r io.Reader) (*Model, error)

ParseHCL parses the given HCL formatted io.Reader into a Model by manually reading the HCL's body content (blocks, attributes, etc.) and converting it into a layupv1.Model based on Layup's HCL schema(s).

func (*Model) Descriptor deprecated

func (*Model) Descriptor() ([]byte, []int)

Deprecated: Use Model.ProtoReflect.Descriptor instead.

func (*Model) GetAttributes

func (x *Model) GetAttributes() map[string]*structpb.Value

func (*Model) GetLayers

func (x *Model) GetLayers() []*Layer

func (*Model) GetUri

func (x *Model) GetUri() string

func (*Model) ProtoMessage

func (*Model) ProtoMessage()

func (*Model) ProtoReflect

func (x *Model) ProtoReflect() protoreflect.Message

func (*Model) Reset

func (x *Model) Reset()

func (*Model) String

func (x *Model) String() string

func (*Model) Validate

func (m *Model) Validate() error

Validate checks the field values on Model with the rules defined in the proto definition for this message. If any rules are violated, the first error encountered is returned, or nil if there are no violations.

func (*Model) ValidateAll

func (m *Model) ValidateAll() error

ValidateAll checks the field values on Model with the rules defined in the proto definition for this message. If any rules are violated, the result is a list of violation errors wrapped in ModelMultiError, or nil if none found.

type ModelMultiError

type ModelMultiError []error

ModelMultiError is an error wrapping multiple validation errors returned by Model.ValidateAll() if the designated constraints aren't met.

func (ModelMultiError) AllErrors

func (m ModelMultiError) AllErrors() []error

AllErrors returns a list of validation violation errors.

func (ModelMultiError) Error

func (m ModelMultiError) Error() string

Error returns a concatenation of all the error messages it wraps.

type ModelValidationError

type ModelValidationError struct {
	// contains filtered or unexported fields
}

ModelValidationError is the validation error returned by Model.Validate if the designated constraints aren't met.

func (ModelValidationError) Cause

func (e ModelValidationError) Cause() error

Cause function returns cause value.

func (ModelValidationError) Error

func (e ModelValidationError) Error() string

Error satisfies the builtin error interface

func (ModelValidationError) ErrorName

func (e ModelValidationError) ErrorName() string

ErrorName returns error name.

func (ModelValidationError) Field

func (e ModelValidationError) Field() string

Field function returns field value.

func (ModelValidationError) Key

func (e ModelValidationError) Key() bool

Key function returns key value.

func (ModelValidationError) Reason

func (e ModelValidationError) Reason() string

Reason function returns reason value.

type Node

type Node struct {
	Id         string                     `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"`
	Attributes map[string]*structpb.Value `` /* 161-byte string literal not displayed */
	// contains filtered or unexported fields
}

A node is a single piece of data in the graph.

func (*Node) Descriptor deprecated

func (*Node) Descriptor() ([]byte, []int)

Deprecated: Use Node.ProtoReflect.Descriptor instead.

func (*Node) GetAttributes

func (x *Node) GetAttributes() map[string]*structpb.Value

func (*Node) GetId

func (x *Node) GetId() string

func (*Node) ProtoMessage

func (*Node) ProtoMessage()

func (*Node) ProtoReflect

func (x *Node) ProtoReflect() protoreflect.Message

func (*Node) Reset

func (x *Node) Reset()

func (*Node) String

func (x *Node) String() string

func (*Node) Validate

func (m *Node) Validate() error

Validate checks the field values on Node with the rules defined in the proto definition for this message. If any rules are violated, the first error encountered is returned, or nil if there are no violations.

func (*Node) ValidateAll

func (m *Node) ValidateAll() error

ValidateAll checks the field values on Node with the rules defined in the proto definition for this message. If any rules are violated, the result is a list of violation errors wrapped in NodeMultiError, or nil if none found.

type NodeMultiError

type NodeMultiError []error

NodeMultiError is an error wrapping multiple validation errors returned by Node.ValidateAll() if the designated constraints aren't met.

func (NodeMultiError) AllErrors

func (m NodeMultiError) AllErrors() []error

AllErrors returns a list of validation violation errors.

func (NodeMultiError) Error

func (m NodeMultiError) Error() string

Error returns a concatenation of all the error messages it wraps.

type NodeValidationError

type NodeValidationError struct {
	// contains filtered or unexported fields
}

NodeValidationError is the validation error returned by Node.Validate if the designated constraints aren't met.

func (NodeValidationError) Cause

func (e NodeValidationError) Cause() error

Cause function returns cause value.

func (NodeValidationError) Error

func (e NodeValidationError) Error() string

Error satisfies the builtin error interface

func (NodeValidationError) ErrorName

func (e NodeValidationError) ErrorName() string

ErrorName returns error name.

func (NodeValidationError) Field

func (e NodeValidationError) Field() string

Field function returns field value.

func (NodeValidationError) Key

func (e NodeValidationError) Key() bool

Key function returns key value.

func (NodeValidationError) Reason

func (e NodeValidationError) Reason() string

Reason function returns reason value.

Jump to

Keyboard shortcuts

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