soko

package module
v0.0.2 Latest Latest
Warning

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

Go to latest
Published: Jul 17, 2015 License: MIT Imports: 8 Imported by: 0

README

soko

Metadata Manager, backended with Consul, EC2, OpenStack Nova and so on

Install

[cloud-user@www901 ~]$ ./soko help
Usage of ./soko:
  -server-id="f6809f77-e7b2-4d66-832e-XXXX": Target server's ID to get/put/delete. Defaults to cloud-init's server ID
[cloud-user@www901 ~]$ ./soko get Hi
Value for Hi seems to be empty.

[cloud-user@www901 ~]$ ./soko get Test
Value for Test seems to be empty.

[cloud-user@www901 ~]$ ./soko put Test Hello
OK
[cloud-user@www901 ~]$ ./soko get Test
Hello
[cloud-user@www901 ~]$ ./soko delete Test
OK
[cloud-user@www901 ~]$ ./soko get Test
Value for Test seems to be empty.

soko will work on

  • Cloud servers(such as EC2, OpenStack... with file /var/lib/cloud/data/instance-id existing)
  • Cousul cluster backended

Yaruzo!!

  • OpenSTack metadata backend
  • EC2 tags backend
  • Redis....??????

Documentation

Index

Constants

View Source
const Version = "0.0.2"

Variables

This section is empty.

Functions

func CloudServerID

func CloudServerID() string

func WriteToConfig added in v0.0.2

func WriteToConfig(uri string) error

Types

type Backend

type Backend interface {
	// Saves current configuration to a specific file
	Save() error

	// APIs to control backend metadata
	// Gets value from key
	Get(serverID string, key string) (string, error)

	// Put value on the key
	Put(serverID string, key string, value string) error

	// Delete value on the key
	Delete(serverID string, key string) error
}

func FindBackend

func FindBackend(uri string) (Backend, error)

type Config added in v0.0.2

type Config struct {
	URI string
}

func DefaultConfig added in v0.0.2

func DefaultConfig() (*Config, error)

type ConsulBackend

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

func NewConsulBackend

func NewConsulBackend(hostWithPort string, ssl bool) (*ConsulBackend, error)

func (*ConsulBackend) Delete

func (b *ConsulBackend) Delete(serverID string, key string) error

func (*ConsulBackend) Get

func (b *ConsulBackend) Get(serverID string, key string) (string, error)

func (*ConsulBackend) Put

func (b *ConsulBackend) Put(serverID string, key string, value string) error

func (*ConsulBackend) Save

func (b *ConsulBackend) Save() error

type Runner

type Runner struct {
	ServerID string
	// contains filtered or unexported fields
}

func (*Runner) Delete

func (r *Runner) Delete(key string)

func (*Runner) Get

func (r *Runner) Get(key string)

func (*Runner) Put

func (r *Runner) Put(key string, value string)

func (*Runner) Run

func (r *Runner) Run(subcommand string, args []string)

Directories

Path Synopsis
cmd

Jump to

Keyboard shortcuts

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