engine

package
v0.0.0-...-5c680a1 Latest Latest
Warning

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

Go to latest
Published: May 31, 2021 License: GPL-3.0 Imports: 12 Imported by: 0

Documentation

Overview

Package engine is the core of OpenEngine that generates solutions nolint: wrapcheck

Index

Constants

This section is empty.

Variables

View Source
var SPEC string

SPEC is global variable to store OpenEngine default specifications nolint

Functions

This section is empty.

Types

type Engine

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

An Engine is the OpenEngine interface - all actions should be done using it.

func NewEngine

func NewEngine(spec string) (*Engine, error)

NewEngine creates an Engine and initialize it.

func (*Engine) Add

func (e *Engine) Add(def, content string) error

Add cue definition to engine.

func (*Engine) AddResource

func (e *Engine) AddResource(resource Resource) error

AddResource adds resource to Engine.

func (*Engine) AddSystem

func (e *Engine) AddSystem(system System) error

AddSystem adds system to Engine.

func (Engine) GetSpec

func (e Engine) GetSpec() string

GetSpec return engine current specification for debugging.

func (*Engine) Solutions

func (e *Engine) Solutions(action string) (results string, err error)

Solutions is the Engine purpose.

type Resource

type Resource struct {
	Type                   string                 `json:"type"`
	Name                   string                 `json:"name,omitempty"`
	Properties             map[string]interface{} `json:"properties"`
	System                 System                 `json:"system,omitempty"`
	Dependencies           []string               `json:"dependencies,omitempty"`
	InterfacesDependencies []string               `json:"interfacesDependencies,omitempty"`
}

Resource is the user requested resource with its type and parameters.

type System

type System struct {
	Type       string                 `json:"type,omitempty"`
	Properties map[string]interface{} `json:"properties"`
}

System is a provider instance that contains matching values and other metadata such as credentials.

Jump to

Keyboard shortcuts

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