servicetemplate

package
v0.0.0-...-1c5d739 Latest Latest
Warning

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

Go to latest
Published: Dec 14, 2023 License: Apache-2.0 Imports: 9 Imported by: 20

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (

	//MAPPING is the elastic mapping for a service template
	MAPPING, _ = elastic.NewMapping(mappingString)
)

Functions

func GetType

func GetType() string

GetType return the serviceTemplate's type It returns the type as a string

func Key

func Key(id string) datastore.Key

Key creates a Key suitable for getting, putting and deleting ResourcePools

Types

type ServiceTemplate

type ServiceTemplate struct {
	ID          string                                  // Unique ID of this service template
	Name        string                                  // Name of service template
	Version     string                                  // Version of the service
	Description string                                  // Meaningful description of service
	Services    []servicedefinition.ServiceDefinition   // Child services
	ConfigFiles map[string]servicedefinition.ConfigFile // Config file templates
	datastore.VersionedEntity
}

ServiceTemplate type to hold service definitions

func BuildFromPath

func BuildFromPath(path string) (*ServiceTemplate, error)

BuildFromPath given a path will create a ServiceDefintion

func FromJSON

func FromJSON(data string) (*ServiceTemplate, error)

FromJSON creates a ServiceTemplate from the json string

func (*ServiceTemplate) Equals

func (a *ServiceTemplate) Equals(b *ServiceTemplate) bool

Equals checks the equality of two service templates

func (*ServiceTemplate) GetID

func (st *ServiceTemplate) GetID() string

GetID return a ServiceTemplate instance's ID It returns the ID as a string

func (*ServiceTemplate) GetType

func (st *ServiceTemplate) GetType() string

GetType returns the ServiceTemplate instance's type It returns the type as a string

func (*ServiceTemplate) Hash

func (a *ServiceTemplate) Hash() (string, error)

func (*ServiceTemplate) ValidEntity

func (st *ServiceTemplate) ValidEntity() error

ValidEntity ensure that a ServiceTemplate has valid values

type ServiceTemplateDeploymentRequest

type ServiceTemplateDeploymentRequest struct {
	PoolID       string // Pool Id to deploy service into
	TemplateID   string // Id of template to be deployed
	DeploymentID string // Unique id of the instance of this template
}

A request to deploy a service template

type Store

type Store interface {
	// Get a ServiceTemplate by id. Return ErrNoSuchEntity if not found
	Get(ctx datastore.Context, id string) (*ServiceTemplate, error)

	// Put adds or updates a ServiceTemplate
	Put(ctx datastore.Context, st ServiceTemplate) error

	// Delete removes the a ServiceTemplate if it exists
	Delete(ctx datastore.Context, id string) error

	// GetServiceTemplates returns all ServiceTemplates
	GetServiceTemplates(ctx datastore.Context) ([]*ServiceTemplate, error)
}

Store type for interacting with ResourcePool persistent storage

func NewStore

func NewStore() Store

NewStore creates a ResourcePool store

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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