Documentation ¶
Index ¶
- Variables
- func WriteD2(w io.Writer, m *Model) error
- func WriteDOT(w io.Writer, m *Model) error
- func WriteMermiad(w io.Writer, m *Model) error
- type Layer
- func (*Layer) Descriptor() ([]byte, []int)deprecated
- func (x *Layer) GetAttributes() map[string]*structpb.Value
- func (x *Layer) GetDynamic() bool
- func (x *Layer) GetId() string
- func (x *Layer) GetLinks() []*Link
- func (x *Layer) GetNodes() []*Node
- func (*Layer) ProtoMessage()
- func (x *Layer) ProtoReflect() protoreflect.Message
- func (x *Layer) Reset()
- func (x *Layer) String() string
- func (m *Layer) Validate() error
- func (m *Layer) ValidateAll() error
- type LayerMultiError
- type LayerValidationError
- type Link
- func (*Link) Descriptor() ([]byte, []int)deprecated
- func (x *Link) GetAttributes() map[string]*structpb.Value
- func (x *Link) GetFrom() string
- func (x *Link) GetId() string
- func (x *Link) GetTo() string
- func (*Link) ProtoMessage()
- func (x *Link) ProtoReflect() protoreflect.Message
- func (x *Link) Reset()
- func (x *Link) String() string
- func (m *Link) Validate() error
- func (m *Link) ValidateAll() error
- type LinkMultiError
- type LinkValidationError
- type Model
- func (*Model) Descriptor() ([]byte, []int)deprecated
- func (x *Model) GetAttributes() map[string]*structpb.Value
- func (x *Model) GetLayers() []*Layer
- func (x *Model) GetUri() string
- func (*Model) ProtoMessage()
- func (x *Model) ProtoReflect() protoreflect.Message
- func (x *Model) Reset()
- func (x *Model) String() string
- func (m *Model) Validate() error
- func (m *Model) ValidateAll() error
- type ModelMultiError
- type ModelValidationError
- type Node
- func (*Node) Descriptor() ([]byte, []int)deprecated
- func (x *Node) GetAttributes() map[string]*structpb.Value
- func (x *Node) GetId() string
- func (*Node) ProtoMessage()
- func (x *Node) ProtoReflect() protoreflect.Message
- func (x *Node) Reset()
- func (x *Node) String() string
- func (m *Node) Validate() error
- func (m *Node) ValidateAll() error
- type NodeMultiError
- type NodeValidationError
Constants ¶
This section is empty.
Variables ¶
var File_layup_v1_layup_proto protoreflect.FileDescriptor
Functions ¶
func WriteD2 ¶
WriteD2 writes a D2 (Terrastruct) 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) GetDynamic ¶
func (*Layer) ProtoMessage ¶
func (*Layer) ProtoMessage()
func (*Layer) ProtoReflect ¶
func (x *Layer) ProtoReflect() protoreflect.Message
func (*Layer) Validate ¶
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 ¶
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 ¶
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) ProtoMessage ¶
func (*Link) ProtoMessage()
func (*Link) ProtoReflect ¶
func (x *Link) ProtoReflect() protoreflect.Message
func (*Link) Validate ¶
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 ¶
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 ¶
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) ProtoMessage ¶
func (*Model) ProtoMessage()
func (*Model) ProtoReflect ¶
func (x *Model) ProtoReflect() protoreflect.Message
func (*Model) Validate ¶
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 ¶
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) ProtoMessage ¶
func (*Node) ProtoMessage()
func (*Node) ProtoReflect ¶
func (x *Node) ProtoReflect() protoreflect.Message
func (*Node) Validate ¶
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 ¶
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.