model

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Mar 14, 2026 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func MarshalCanonical

func MarshalCanonical(mdl ResilienceModel) ([]byte, error)

func WriteToFile

func WriteToFile(path string, mdl ResilienceModel) error

Types

type Edge

type Edge struct {
	From     string   `json:"from"`
	To       string   `json:"to"`
	Kind     EdgeKind `json:"kind"`
	Blocking bool     `json:"blocking"`
}

type EdgeKind

type EdgeKind string
const (
	EdgeKindSync  EdgeKind = "sync"
	EdgeKindAsync EdgeKind = "async"
)

type Endpoint

type Endpoint struct {
	ID                  string `json:"id"`
	EntryService        string `json:"entry_service"`
	SuccessPredicateRef string `json:"success_predicate_ref"`
}

type Metadata

type Metadata struct {
	SourceType   string    `json:"source_type"`
	SourceRef    string    `json:"source_ref"`
	DiscoveredAt string    `json:"discovered_at"`
	Confidence   float64   `json:"confidence"`
	Schema       SchemaRef `json:"schema"`
}

type ResilienceModel

type ResilienceModel struct {
	Services  []Service  `json:"services"`
	Edges     []Edge     `json:"edges"`
	Endpoints []Endpoint `json:"endpoints"`
	Metadata  Metadata   `json:"metadata"`
}

func LoadFromFile

func LoadFromFile(path string) (ResilienceModel, error)

func ParseJSON

func ParseJSON(raw []byte) (ResilienceModel, error)

func (*ResilienceModel) SortDeterministic

func (m *ResilienceModel) SortDeterministic()

func (ResilienceModel) ValidateSemantic

func (m ResilienceModel) ValidateSemantic() error

type SchemaRef

type SchemaRef struct {
	Name    string `json:"name"`
	Version string `json:"version"`
	URI     string `json:"uri"`
	Digest  string `json:"digest"`
}

type Service

type Service struct {
	ID       string `json:"id"`
	Name     string `json:"name"`
	Replicas int    `json:"replicas"`
}

Jump to

Keyboard shortcuts

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