docparser

package
v0.0.0-...-0117b6e Latest Latest
Warning

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

Go to latest
Published: May 2, 2024 License: Apache-2.0 Imports: 12 Imported by: 6

Documentation

Overview

Package docparser contains methods for parsing and encoding any type of document, i.e. association document, MDS/SSM messages, offline service documents, etc.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func InitializeDocState

func InitializeDocState(
	context context.T,
	documentType contracts.DocumentType,
	docContent IDocumentContent,
	docInfo contracts.DocumentInfo,
	parserInfo DocumentParserInfo,
	params map[string]interface{}) (docState contracts.DocumentState, err error)

InitializeDocState is a method to obtain the state of the document. This method calls into ParseDocument to obtain the InstancePluginInformation

func ParseDocumentNameAndVersion

func ParseDocumentNameAndVersion(name string) (docName, docVersion string)

ParseDocumentNameAndVersion parses the name and version from the document name

func ParseParameters

func ParseParameters(log log.T, params map[string][]*string, paramsDef map[string]*contracts.Parameter) map[string]interface{}

ParseParameters is a method to parse the ssm parameters into a string map interface

Types

type DocContent

type DocContent contracts.DocumentContent

TODO: move DocumentContent/SessionDocumentContent from contracts to docparser.

func (*DocContent) GetIOConfiguration

func (docContent *DocContent) GetIOConfiguration(parserInfo DocumentParserInfo) contracts.IOConfiguration

GetIOConfiguration is a method used to get IO config from the document

func (*DocContent) GetSchemaVersion

func (docContent *DocContent) GetSchemaVersion() string

GetSchemaVersion is a method used to get document schema version

func (*DocContent) ParseDocument

func (docContent *DocContent) ParseDocument(context context.T,
	docInfo contracts.DocumentInfo,
	parserInfo DocumentParserInfo,
	params map[string]interface{}) (pluginsInfo []contracts.PluginState, err error)

ParseDocument is a method used to parse documents that are not received by any service (MDS or State manager)

type DocumentParserInfo

type DocumentParserInfo struct {
	OrchestrationDir  string
	S3Bucket          string
	S3Prefix          string
	MessageId         string
	DocumentId        string
	DefaultWorkingDir string
	CloudWatchConfig  contracts.CloudWatchConfiguration
}

DocumentParserInfo represents the parsed information from the request

type IDocumentContent

type IDocumentContent interface {
	GetSchemaVersion() string
	GetIOConfiguration(parserInfo DocumentParserInfo) contracts.IOConfiguration
	ParseDocument(context context.T, docInfo contracts.DocumentInfo, parserInfo DocumentParserInfo, params map[string]interface{}) (pluginsInfo []contracts.PluginState, err error)
}

type SessionDocContent

type SessionDocContent contracts.SessionDocumentContent

func (*SessionDocContent) GetIOConfiguration

func (sessionDocContent *SessionDocContent) GetIOConfiguration(parserInfo DocumentParserInfo) contracts.IOConfiguration

GetIOConfiguration is a method used to get IO config from the document

func (*SessionDocContent) GetSchemaVersion

func (sessionDocContent *SessionDocContent) GetSchemaVersion() string

GetSchemaVersion is a method used to get document schema version

func (*SessionDocContent) ParseDocument

func (sessionDocContent *SessionDocContent) ParseDocument(context context.T,
	docInfo contracts.DocumentInfo,
	parserInfo DocumentParserInfo,
	params map[string]interface{}) (pluginsInfo []contracts.PluginState, err error)

ParseDocument is a method used to parse documents that are not received by any service (MDS or State manager)

Directories

Path Synopsis
Package parameters provides utilities to parse ssm document parameters
Package parameters provides utilities to parse ssm document parameters
Package parameterstore contains modules to resolve ssm parameters present in the document.
Package parameterstore contains modules to resolve ssm parameters present in the document.
Package paramvalidator is responsible for registering all the param validators available and exposes getter functions to be utilized by other modules
Package paramvalidator is responsible for registering all the param validators available and exposes getter functions to be utilized by other modules
allowedregexparamvalidator
Package allowedregexparamvalidator is responsible for validating parameter value with regex pattern given in the document.
Package allowedregexparamvalidator is responsible for validating parameter value with regex pattern given in the document.
allowedvalueparamvalidator
Package allowedvalueparamvalidator is responsible for validating parameter value with the allowed values given in the document.
Package allowedvalueparamvalidator is responsible for validating parameter value with the allowed values given in the document.
minmaxcharparamvalidator
Package minmaxcharparamvalidator is responsible for validating parameter value with the min max char restriction given in the document for parameters.
Package minmaxcharparamvalidator is responsible for validating parameter value with the min max char restriction given in the document for parameters.
minmaxitemparamvalidator
Package minmaxitemparamvalidator is responsible for validating parameter value with the min max item restriction given in the document for parameters.
Package minmaxitemparamvalidator is responsible for validating parameter value with the min max item restriction given in the document for parameters.

Jump to

Keyboard shortcuts

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