scv

package module
v0.0.5 Latest Latest
Warning

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

Go to latest
Published: Jul 30, 2017 License: MIT Imports: 8 Imported by: 0

README

scv

VNC path creator for SAKURA Cloud

Installation

Download a binary from here.

Precondition

If you use this cli tool, you have to turn on a SAKURA Cloud server power.

Usage

  • Create a config file at $HOME/.scv.json.
  • Write a config file refering to .scv.sample.json.
    • This file's server name don't have to match the SAKURA cloud sever name.
  • Run below command.
# Format
$ scv ZONE_NAME SERVER_NAME

# Example
$ scv is1a ubuntu

Options

Name Description
-h, --help print help message and exit
-v, --verbose print debug log
-V, --version print version and exit

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Run

func Run() (result string, err error)

Types

type Api

type Api struct {
	ZoneName          string
	ServerID          string
	AccessToken       string
	AccessTokenSecret string
	Logger            Logger
}

func (*Api) GetServerAddress

func (api *Api) GetServerAddress() (serverAddress string, err error)

type Body

type Body struct {
	Host     string `json:"Host"`
	Password string `json:"Password"`
	Port     string `json:"Port"`
}

type Config

type Config struct {
	AccessToken       string   `json:"access_token"`
	AccessTokenSecret string   `json:"access_token_secret"`
	Servers           []Server `json:"servers"`
}

func (*Config) GetServerID

func (config *Config) GetServerID(zoneName string, serverName string) (id string, err error)

func (*Config) LoadFile

func (config *Config) LoadFile(dir string) (err error)

type Logger

type Logger struct {
	Verbose bool
}

func (*Logger) Debug

func (logger *Logger) Debug(a string) (n int, err error)

func (*Logger) Fatal

func (logger *Logger) Fatal(a interface{}) (n int, err error)

NOTE: (a interface{}) is expected to be string or error.

func (*Logger) Info

func (logger *Logger) Info(a string) (n int, err error)

type Server

type Server struct {
	Name     string `json:"name"`
	ZoneName string `json:"zone_name"`
	ID       string `json:"id"`
}

Directories

Path Synopsis
cmd
scv

Jump to

Keyboard shortcuts

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