stufy

package module
v0.2.2 Latest Latest
Warning

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

Go to latest
Published: Mar 26, 2019 License: MIT Imports: 13 Imported by: 0

README

Stufy Build Status

Stufy is a standalone cli for managing statusfy deployment.

You will able to create incident events and scheduleds tasks and managed them without having nodejs stack installed.

statusfy has the good idea to let you deploy status page as a static webpage by simply pushing commits on a git repository and be available as gitlab/github pages. With this in mind, with this cli you could directly create/update/delete incidents and scheduleds tasks by simply set a git repo as a target. You don't even need git installed on your machine.

Important: For now stufy only support config file in yaml.

install

On *nix system

You can install this via the command-line with either curl or wget.

via curl
$ bash -c "$(curl -fsSL https://raw.github.com/ArthurHlt/stufy/master/bin/install.sh)"
via wget
$ bash -c "$(wget https://raw.github.com/ArthurHlt/stufy/master/bin/install.sh -O -)"
On windows

You can install it by downloading the .exe corresponding to your cpu from releases page: https://github.com/ArthurHlt/stufy/releases . Alternatively, if you have terminal interpreting shell you can also use command line script above, it will download file in your current working dir.

From go command line

Simply run in terminal:

$ go get github.com/ArthurHlt/stufy

Usage

Usage:
  cli [OPTIONS] <command>

Application Options:
  -t, --target=  Set a target, this can be a directory path or a git repo (e.g.: [email protected]:ArthurHlt/stufy-test.git or
                 https://user:[email protected]/ArthurHlt/stufy-test.git)
  -v, --version  Show version

Help Options:
  -h, --help     Show this help message

Available commands:
  add-alias         Add an alias to your current target to use instead of plain target (aliases: a)
  delete-incident   Delete an existing incident (aliases: d)
  delete-scheduled  Delete an existing scheduled task (aliases: ds)
  finish-scheduled  Finish a scheduled task (aliases: fs)
  list-incidents    List incidents (aliases: li)
  list-scheduleds   List scheduleds (aliases: ls)
  new-incident      Create a new incident (aliases: n)
  new-scheduled     Create a new scheduled task (aliases: ns)
  remove-alias      Remove an alias (aliases: ra)
  resync            Resynchronize your target (useful when merging issue on git repo) (aliases: r)
  update-incident   Update an existing incident (aliases: u)
  update-scheduled  Update an existing scheduled task (aliases: us)

Note: When you choose to open editor you can also set default editor with env var EDITOR.

Auto completion

Here is an example how to activate bash auto completion for stufy:

_completion_stufy() {
    # All arguments except the first one
    args=("${COMP_WORDS[@]:1:$COMP_CWORD}")

    # Only split on newlines
    local IFS=$'\n'

    # Call completion (note that the first element of COMP_WORDS is
    # the executable itself)
    COMPREPLY=($(GO_FLAGS_COMPLETION=1 ${COMP_WORDS[0]} "${args[@]}"))
    return 0
}

complete -F _completion_stufy stufy

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Alias

type Alias struct {
	Name   string `json:"name"`
	Target string `json:"target"`
}

type Aliases

type Aliases []Alias

func (Aliases) FindTarget

func (as Aliases) FindTarget(name string) string

type DotConfig

type DotConfig struct {
	Aliases Aliases `json:"aliases"`
}

type Manager

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

func NewManager

func NewManager(target string) (*Manager, error)

func (Manager) AddAlias

func (m Manager) AddAlias(alias string) error

func (Manager) Aliases

func (m Manager) Aliases() Aliases

func (Manager) Config

func (m Manager) Config() (model.Config, error)

func (Manager) CreateIncident

func (m Manager) CreateIncident(req RequestCreate) error

func (Manager) CreateScheduled

func (m Manager) CreateScheduled(req RequestScheduled) error

func (Manager) DeleteIncident

func (m Manager) DeleteIncident(req RequestDelete) error

func (Manager) DeleteScheduled

func (m Manager) DeleteScheduled(req RequestUnscheduled) error

func (Manager) FindIncident

func (m Manager) FindIncident(incidentFilename string) (model.Incident, error)

func (Manager) FinishScheduled

func (m Manager) FinishScheduled(req RequestUnscheduled) error

func (*Manager) ListIncident

func (m *Manager) ListIncident(showResolved bool) (model.Incidents, error)

func (*Manager) ListScheduled

func (m *Manager) ListScheduled(showResolved bool) (model.Incidents, error)

func (Manager) Open added in v0.2.2

func (m Manager) Open(incident model.Incident) (model.Incident, error)

func (Manager) RemoveAlias

func (m Manager) RemoveAlias(alias string) error

func (*Manager) Resync added in v0.1.2

func (m *Manager) Resync() error

func (Manager) UpdateIncident

func (m Manager) UpdateIncident(req RequestUpdate) error

func (Manager) UpdateScheduled

func (m Manager) UpdateScheduled(req RequestUpdateScheduled) error

type RequestCreate

type RequestCreate struct {
	Cause       string
	Description string
	Severity    string
	Systems     []string
	Open        bool
}

type RequestDelete

type RequestDelete struct {
	Filename string
	Confirm  bool
}

type RequestScheduled

type RequestScheduled struct {
	Title       string
	Description string
	Systems     []string
	Duration    string
	Date        string
	Open        bool
}

type RequestUnscheduled

type RequestUnscheduled struct {
	Filename string
	Confirm  bool
}

type RequestUpdate

type RequestUpdate struct {
	Filename      string
	Severity      string
	Systems       []string
	UpdateType    string
	UpdateContent string
	Resolved      bool
	Open          bool
	Confirm       bool
}

type RequestUpdateScheduled

type RequestUpdateScheduled struct {
	Filename    string
	Description string
	Systems     []string
	Duration    string
	Date        string
	Open        bool
	Confirm     bool
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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