integration

package
v0.3.2 Latest Latest
Warning

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

Go to latest
Published: Sep 24, 2018 License: BSD-3-Clause Imports: 23 Imported by: 4

Documentation

Overview

Package integration defines interfaces and helpers for writing integrations with Serulian.

Index

Constants

View Source
const IntegrationConstName = "SerulianIntegration"

IntegrationConstName defines the name of the root-level const that holds the Integration.

Variables

This section is empty.

Functions

func DescribeIntegration added in v0.3.0

func DescribeIntegration(integrationID string) bool

DescribeIntegration describes a particular integration.

func InstallIntegration added in v0.3.0

func InstallIntegration(repoURL string, debug bool) bool

InstallIntegration installs a particular integration.

func ListIntegrations added in v0.3.0

func ListIntegrations() bool

ListIntegrations lists all installed integrations on the command line.

func UninstallIntegration added in v0.3.0

func UninstallIntegration(integrationID string, skipPrompt bool) bool

UninstallIntegration uninstalls a particular integration by deleting its binary.

func UpgradeIntegration added in v0.3.0

func UpgradeIntegration(integrationID string, skipPrompt bool, debug bool) bool

UpgradeIntegration upgrades a particular integration by downloading a new version.

Types

type BundlerIntegration added in v0.3.0

type BundlerIntegration interface {
	LanguageIntegration

	// PopulateFilesToBundle is invoked by the builder to have the integration populate the file bundle produced
	// by the builder with any files necessary. Note that this method is invoked *before* the source is
	// added to the file bundle, which means it will be overridden if added by this integration
	// (which, in any case, it shouldn't do).
	PopulateFilesToBundle(bundler bundle.Bundler)
}

BundlerIntegration defines an integration that adds files to the bundle produced by the builder.

type Implementation added in v0.3.0

type Implementation interface{}

Implementation defines an integration for the Serulian toolkit. Implementation will typically match one of the integration interfaces:

  • LanguageIntegration

type Integration added in v0.3.0

type Integration interface {
	// SerulianIntegrations returns all integrations defined by the provider.
	IntegrationImplementations() []Implementation
}

Integration defines an interface for returing all integration implementations.

func LoadIntegrations added in v0.3.0

func LoadIntegrations() ([]Integration, error)

LoadIntegrations loads all the integrations found for the current toolkit.

type IntegrationInformation added in v0.3.0

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

func LoadIntegrationsAndInfo added in v0.3.0

func LoadIntegrationsAndInfo() ([]IntegrationInformation, error)

LoadIntegrationsAndInfo loads all the integration found for the current toolkit.

func (IntegrationInformation) ID added in v0.3.0

func (IntegrationInformation) Integration added in v0.3.0

func (ii IntegrationInformation) Integration() Integration

type LanguageIntegration

type LanguageIntegration interface {
	// SourceHandler returns the source handler used to load, parse and validate the input
	// source file(s) for the integrated language or system. Note that calling this method
	// will typically start a modifier, so it should only be called if the full handler
	// lifecycle will be used.
	SourceHandler() packageloader.SourceHandler

	// TypeConstructor returns the type constructor used to construct the types and members that
	// should be added to the type system by the integrated language or system.
	TypeConstructor() typegraph.TypeGraphConstructor

	// PathHandler returns a handler for translating generated paths to those provided by the integration.
	// If the integration returns nil, then no translation is done.
	PathHandler() PathHandler
}

LanguageIntegration defines an integration of an external language or system into Serulian.

func GetLanguageIntegrations added in v0.3.0

func GetLanguageIntegrations(integration Integration, graph compilergraph.SerulianGraph) []LanguageIntegration

GetLanguageIntegrations returns all language integrations provided by the given integration.

type PathHandler

type PathHandler interface {
	// GetStaticMemberPath returns the global path for the given statically defined type member. If the handler
	// returns empty string, the default path will be used.
	GetStaticMemberPath(member typegraph.TGMember, referenceType typegraph.TypeReference) string

	// GetModulePath returns the global path for the given module. If the handler
	// returns empty string, the default path will be used.
	GetModulePath(module typegraph.TGModule) string
}

PathHandler translates various paths encountered during code generation into those provided by the integration, if any.

Jump to

Keyboard shortcuts

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