serviceManifest

package
v0.0.0-...-60089aa Latest Latest
Warning

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

Go to latest
Published: Jun 27, 2021 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type DecoderInterface

type DecoderInterface interface {
	DecodeManifest(bytes []byte, varsFilePaths []string, vars map[string]string) (*ServiceManifest, error)
}

DecoderInterface describes the method needed to decode a bytestream to a ServiceManifest

type FileIO

type FileIO struct {
	FileIOInterface
}

FileIO struct

func NewFileIO

func NewFileIO() *FileIO

NewFileIO initializes a new mock decoder

func (*FileIO) IsNotExist

func (fio *FileIO) IsNotExist(err error) bool

IsNotExist returns a boolean as to weather a file exists

func (*FileIO) OpenReadOnly

func (fio *FileIO) OpenReadOnly(filename string) (io.Reader, error)

OpenReadOnly performs an os.Open on a given filename

func (*FileIO) Stat

func (fio *FileIO) Stat(name string) (os.FileInfo, error)

Stat returns a FileInfo object for the given filename, name.

type FileIOInterface

type FileIOInterface interface {
	Stat(name string) (os.FileInfo, error)
	IsNotExist(err error) bool
	OpenReadOnly(filename string) (io.Reader, error)
}

FileIOInterface interface

type ParseData

type ParseData struct {
	Parser  ParserInterface
	Reader  io.Reader
	Decoder DecoderInterface
	FileIO  FileIOInterface
}

ParseData holds the Parser reader and the interface that will provide the methods to process the input data

func NewParser

func NewParser() *ParseData

NewParser returns a ParseData structure with the default interfaces described in its struct

func (*ParseData) CreateParser

func (p *ParseData) CreateParser(filename string) (*ParseData, error)

CreateParser returns a Parser struct with a reader

func (*ParseData) Parse

func (p *ParseData) Parse(varsFilePaths []string, vars map[string]string) (*ServiceManifest, error)

Parse parses a manifest from a reader

type ParserInterface

type ParserInterface interface {
	Parse(varsFilePaths []string, vars map[string]string) (*ServiceManifest, error)
	CreateParser(filename string) (*ParseData, error)
}

ParserInterface is an interface describing the default methods used to decode a manifest file

type Service

type Service struct {
	ServiceName    string            `yaml:"name"`
	Type           string            `yaml:"type"` //brokered, credentials, drain, route.  "blank" == brokered
	Broker         string            `yaml:"broker"`
	PlanName       string            `yaml:"plan"`
	URL            string            `yaml:"url"`
	UpdateService  bool              `yaml:"updateService"` // Does not update service plan. This should be done manually.
	Credentials    map[string]string `yaml:"credentials"`
	Tags           string            `yaml:"tags"`
	JSONParameters string            `yaml:"parameters"`
}

Service describes a CF service that will be instantiated

type ServiceManifest

type ServiceManifest struct {
	Services []Service `yaml:"create-services"`
}

ServiceManifest describes a service Manifest as an array of services

type YmlDecoder

type YmlDecoder struct {
}

YmlDecoder is

func NewYmlDecoder

func NewYmlDecoder() *YmlDecoder

NewYmlDecoder initializes a new YAML Decoder

func (*YmlDecoder) DecodeManifest

func (yml *YmlDecoder) DecodeManifest(bytes []byte, varsFilePaths []string, vars map[string]string) (*ServiceManifest, error)

DecodeManifest unmarshals a bytestream into a ServiceManifest struct using yaml.v2 In addition, it will also evaluate any templated variables that are specified in the input service manifest yaml

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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