reco

package module
v0.6.0 Latest Latest
Warning

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

Go to latest
Published: Aug 9, 2018 License: Apache-2.0 Imports: 26 Imported by: 0

README

reco

The Reconfigure.io tool.

Installation

To install from source, check Install from source below.

Linux

Paste into shell

curl -LO https://s3.amazonaws.com/reconfigure.io/reco/releases/reco-master-x86_64-linux.zip \
&& unzip -o reco-master-x86_64-linux.zip \
&& sudo mv reco /usr/local/bin
OSX

Paste into shell

curl -LO https://s3.amazonaws.com/reconfigure.io/reco/releases/reco-master-x86_64-apple-darwin.zip \
&& unzip -o reco-master-x86_64-apple-darwin.zip \
&& sudo mv reco /usr/local/bin
Windows

Launch Powershell as administrator and paste

Invoke-WebRequest https://s3.amazonaws.com/reconfigure.io/reco/releases/reco-master-x86_64-pc-windows.zip -OutFile reco-master-x86_64-pc-windows.zip;
Expand-Archive -Path reco-master-x86_64-pc-windows.zip -DestinationPath C:\reco;
setx PATH "$env:path;C:\reco" -m;

reco will be available in further sessions of cmd or powershell

Usage

reco is the CLI utility for Reconfigure.io

Usage:
  reco [command]

Development Commands:
  build       Manage builds
  check       Verify that the compiler can build your Go source
  deployment  Manage deployments
  graph       Manage graphs
  test        Manage tests

Other Commands:
  auth        Authenticate your account
  completion  Generate bash completion
  project     Manage projects
  version     Show app version

Flags:
  -h, --help             help for reco
      --project string   project to use. If unset, the active project is used
  -s, --source string    source directory (default is current directory ".")

Use "reco [command] --help" for more information about a command.

Hidden Flags and Commands

The following flags are meant for internal use and thereby hidden.

Commands

reco config shows path to the default configuration file

Flags

--config specify a config file

Configuration

The configuration file is optional and reco does not require it to work.

Environment Variables or a reco.yml with the following values set. You can get the path to the reco.yml by running reco config.

# optional
PLATFORM_SERVER # defaults to "https://api.reconfigure.io"

Installation from source

Requires Go 1.6+.

1. Export GOPATH if not set set. You can verify with go env GOPATH.
export GOPATH=$HOME/go
2. Clone the repo into GOPATH
git clone https://github.com/ReconfigureIO/reco $GOPATH/src/github.com/ReconfigureIO/reco
3. Install dependencies

Requires Glide, install if required.

glide -version || curl https://glide.sh/get | sh

cd into the source directory and install dependencies

cd $GOPATH/src/github.com/ReconfigureIO/reco
glide install
4. Build reco
make install

reco should be available in your $PATH afterwards.

Documentation

Index

Constants

View Source
const (
	// GlobalConfigDirKey is the key for reco configuration in viper.
	GlobalConfigDirKey = "reco_global_config_dir"
	// ConfigDirKey is the key for reco configuration for current directory.
	ConfigDirKey = "reco_config_dir"

	StatusWaiting     = "WAITING"
	JobTypeBuild      = "build"
	JobTypeDeployment = "deployment"
	JobTypeSimulation = "simulation"
	JobTypeGraph      = "graph"
)

Variables

View Source
var (
	// StatusSubmitted is submitted job state.
	StatusSubmitted = "SUBMITTED"
	// StatusQueued is queued job state.
	StatusQueued = "QUEUED"
	// StatusCreatingImage is creating image job state.
	StatusCreatingImage = "CREATING_IMAGE"
	// StatusStarted is started job state.
	StatusStarted = "STARTED"
	// StatusTerminating is terminating job state.
	StatusTerminating = "TERMINATING"
	// StatusTerminated is terminated job state.
	StatusTerminated = "TERMINATED"
	// StatusCompleted is completed job state.
	StatusCompleted = "COMPLETED"
	// StatusErrored is errored job state.
	StatusErrored = "ERRORED"
	// An error event with code value 124 indicates timeout
	StatusTimeout = "TIMED-OUT"
	// An error event with Code value 124 indicates timeout
	ErrorCodeTimeout = 124
)
View Source
var (
	ErrNotFound = errors.New("Not found")
)

Functions

func Bool

func Bool(v interface{}) bool

Bool returns bool value of v if v is a bool, or false otherwise.

func Int

func Int(v interface{}) int

Int returns int value of v if v is an int, or 0 otherwise.

func String

func String(v interface{}) string

String returns string value of v if v is a string, or "" otherwise.

func StringSlice

func StringSlice(v interface{}) []string

StringSlice returns strings slice of v if v is a string slice, otherwise returns nil.

Types

type Args

type Args []interface{}

Args is convenience wrapper for []interface to fetch element at without wrong index errors.

func (Args) At

func (a Args) At(i int) interface{}

At returns element at i.

func (Args) First

func (a Args) First() interface{}

First returns first element.

func (Args) Last

func (a Args) Last() interface{}

Last returns last element.

type BuildReporter added in v0.6.0

type BuildReporter interface {
	// Report returns a formatted JSON build report.
	Report(id string) (string, error)
}

BuildReporter can return build reports.

type Client

type Client interface {
	// Init initiates the client.
	Init() error
	// Auth authenticates the user.
	Auth(token string) error
	// Test handles simulation actions.
	Test() Job
	// Build handles build actions.
	Build() Job
	// Deployment handles deployment actions.
	Deployment() Job
	// Project handles project actions.
	Project() ProjectConfig
	// Graph handles graph actions.
	Graph() Graph
}

Client is a reconfigure.io platform client.

func NewClient

func NewClient() Client

NewClient creates a new reconfigure.io client.

type DeploymentProxy

type DeploymentProxy interface {
	// Connect performs a proxy connection.
	Connect(id string, openBrowser bool) error
}

DeploymentProxy proxies to a running deployment instance.

type Endpoint

type Endpoint string

Endpoint is reco client api endpoint.

func (Endpoint) Append

func (p Endpoint) Append(s ...string) string

Append appends strings to endpoint path.

func (Endpoint) Events

func (p Endpoint) Events() string

Events returns events endpoint.

func (Endpoint) Graph

func (p Endpoint) Graph() string

Graph returns graph endpoint.

func (Endpoint) Input

func (p Endpoint) Input() string

Input returns input endpoint.

func (Endpoint) Item

func (p Endpoint) Item() string

Item returns item endpoint.

func (Endpoint) Log

func (p Endpoint) Log() string

Log returns log endpoint.

func (Endpoint) Report added in v0.6.0

func (p Endpoint) Report() string

Report returns report endpoint.

func (Endpoint) String

func (p Endpoint) String() string

String returns underlying string.

type Graph

type Graph interface {
	// Generate generates a graph.
	Generate(Args) (output string, err error)
	// List list graphs.
	List(filter M) (printer.Table, error)
	// Open opens a graph.
	Open(id string) (file string, err error)
}

Graph manages reco graphs.

type Job

type Job interface {
	// Start starts the job.
	Start(Args) (output string, err error)
	// Stop stops the job.
	Stop(id string) error
	// Status returns the status of the job.
	Status(id string) string
	// List lists job resources.
	List(filter M) (printer.Table, error)
	// Log logs the job.
	Log(id string, writer io.Writer) error
}

Job is a set of actions for the reco platform.

type M

type M map[string]interface{}

M is a convenience wrapper for map[string]interface{}.

func (M) Bool

func (m M) Bool(key string) bool

Bool returns value of key as bool.

func (M) HasKey

func (m M) HasKey(key string) bool

HasKey checks if key exists in the map.

func (M) Int

func (m M) Int(key string) int

Int returns value of key as int.

func (M) String

func (m M) String(key string) string

String returns value of key as string.

type ProjectConfig

type ProjectConfig interface {
	// List lists the projects.
	List(filter M) (printer.Table, error)

	// Create create a new project.
	Create(name string) error
	// Set sets the active project.
	Set(name string) error
	// Get gets the name of the active project.
	Get() (string, error)
	// contains filtered or unexported methods
}

ProjectConfig manages projects.

type ProjectInfo

type ProjectInfo struct {
	ID     string `json:"id"`
	Name   string `json:"name"`
	Active bool   `json:"-"`
}

ProjectInfo gives information about a project.

Directories

Path Synopsis
cmd

Jump to

Keyboard shortcuts

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