mapping

package module
v0.0.0-...-868fca8 Latest Latest
Warning

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

Go to latest
Published: Jun 12, 2018 License: MPL-2.0 Imports: 11 Imported by: 2

README

Mapping

master: CircleCI

Mapping is the internal representation of an ernest environment. This library is used to interact with environments inside ernest, it has shortcuts to access many of the env's related endpoints. Some examples are:

You can create a new mapping by only providing environment name:

env := mapping.New(c, "my_env")

And you can interact with it through:

def := definition.New()
// Applies the given definition to current environment
env.Apply(def)
// Deletes the current environment
env.Delete()
// Imports to current environment the result for the specified env
env.Import(filters)
// Diff : gets a mapping for a diff between two environment builds
env.Diff("my_env_1", "my_env_0")

Querying system

Mapping package introduces a querying system described here

Installation

make deps
make install

Running Tests

make deps
make test

Contributing

Please read through our contributing guidelines. Included are directions for opening issues, coding standards, and notes on development.

Moreover, if your pull request contains patches or features, you must include relevant unit tests.

Versioning

For transparency into our release cycle and in striving to maintain backward compatibility, this project is maintained under the Semantic Versioning guidelines.

Code and documentation copyright since 2015 ernest.io authors.

Code released under the Mozilla Public License Version 2.0.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetCredentials

func GetCredentials(c akira.Connector, env string) (map[string]interface{}, error)

GetCredentials : gets credentials from a project

Types

type Mapping

type Mapping struct {
	Environment string
	Changelog   bool
	Result      map[string]interface{}
	Validation  validation.Validation
	// contains filtered or unexported fields
}

Mapping : stores a environments build mapping

func New

func New(c akira.Connector, env string) *Mapping

New : create a new mapping

func (*Mapping) Apply

func (m *Mapping) Apply(d *definition.Definition) error

Apply : apply a definition

func (*Mapping) Delete

func (m *Mapping) Delete() error

Delete : gets a mapping for deleting an environment

func (*Mapping) Diff

func (m *Mapping) Diff(a, b string) error

Diff : gets a mapping for a diff between two environment builds

func (*Mapping) DiffGraphs

func (m *Mapping) DiffGraphs(ag, bg map[string]interface{}) error

DiffGraphs : gets a mpping for a diff between two graphs

func (*Mapping) Import

func (m *Mapping) Import(filters []string) error

Import : gets a mapping for import

func (*Mapping) Validate

func (m *Mapping) Validate() error

Validate : validate a build mapping against an environments policy documents

type Request

type Request struct {
	ID          string                 `json:"id,omitempty"`
	Name        string                 `json:"name,omitempty"`
	UserID      int                    `json:"user_id"`
	Username    string                 `json:"username"`
	Changelog   bool                   `json:"changelog"`
	Filters     []string               `json:"filters,omitempty"`
	Definition  map[string]interface{} `json:"definition,omitempty"`
	From        map[string]interface{} `json:"from,omitempty"`
	To          map[string]interface{} `json:"to,omitempty"`
	Credentials map[string]interface{} `json:"credentials,omitempty"`
}

Request :

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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