glue

package module
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Feb 7, 2019 License: MIT Imports: 8 Imported by: 0

README

GoZix Glue

The package represents a very simple and easy implementation of the extensible application on golang. The core components of an application are bundles that are glued together using a dependency injection container.

Built-in Tags

Symbol Value Description
TagCliCommand cli.cmd Add a cli command
TagRootPersistentFlags cli.persistent_flags Add custom flags to root command

Built-in Services

Symbol Value Description
DefCliRoot cli.cmd.root Add root cli command
DefCliVersion cli.cmd.version Add version cli command
DefRegistry registry A key/value registry

Documentation

Overview

Package glue provide basic functionality.

Package glue provide basic functionality.

Index

Constants

View Source
const (
	// DefCliRoot is root command definition name.
	DefCliRoot = "cli.cmd.root"

	// DefCliVersion is version command definition name.
	DefCliVersion = "cli.cmd.version"

	// DefRegistry is registry definition name.
	DefRegistry = "registry"

	// TagCliCommand is tag to mark exported cli commands.
	TagCliCommand = "cli.cmd"

	// TagRootPersistentFlags is tag to mark FlagSet for add to root command persistent flags
	TagRootPersistentFlags = "cli.persistent_flags"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type App

type App interface {
	Execute() error
}

App interface.

func NewApp

func NewApp(options ...Option) (_ App, err error)

NewApp is app constructor.

type Bundle

type Bundle interface {
	Name() string
	Build(builder *di.Builder) error
}

Bundle is an node interface.

type BundleDependsOn

type BundleDependsOn interface {
	Bundle
	DependsOn() []string
}

BundleDependsOn is an node with dependencies interface.

type Option

type Option interface {
	// contains filtered or unexported methods
}

Option interface.

func Bundles

func Bundles(bundles ...Bundle) Option

Bundles option.

func Scopes

func Scopes(scopes ...string) Option

Scopes option.

func Version

func Version(version string) Option

Version option.

type Registry

type Registry interface {
	Get(name string) interface{}
	Set(name string, value interface{})
	Fill(name string, value interface{}) error
}

Registry interface.

Directories

Path Synopsis
Package mock provide gozix mocks.
Package mock provide gozix mocks.

Jump to

Keyboard shortcuts

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