Documentation ¶
Overview ¶
Package kontrol provides an implementation for the name service kite. It can be queried to get the list of running kites.
Index ¶
Constants ¶
Variables ¶
View Source
var ( TokenTTL = 48 * time.Hour DefaultPort = 4000 )
Functions ¶
This section is empty.
Types ¶
type Kontrol ¶
type Kontrol struct { Kite *kite.Kite // etcd options Name string // Name of the etcd instance DataDir string // etcd data dir EtcdAddr string // The public host:port used for etcd server. EtcdBindAddr string // The listening host:port used for etcd server. PeerAddr string // The public host:port used for peer communication. PeerBindAddr string // The listening host:port used for peer communication. Peers []string // other peers in cluster (must be peer address of other instances) // MachineAuthenticate is used to authenticate the request in the // "handleMachine" method. The reason for a separate auth function is, the // request must not be authenticated because clients do not have a kite.key // before they register to this machine. MachineAuthenticate func(r *kite.Request) error // contains filtered or unexported fields }
func New ¶
New creates a new kontrol instance with the given verson and config instance. Publickey is used for validating tokens and privateKey is used for signing tokens.
peers can be given nil if not running on cluster.
Public and private keys are RSA pem blocks that can be generated with the following command:
openssl genrsa -out testkey.pem 2048 openssl rsa -in testkey.pem -pubout > testkey_pub.pem
func (*Kontrol) AddAuthenticator ¶
func (*Kontrol) ClearKites ¶
ClearKites removes everything under "/kites" from etcd.
func (*Kontrol) RegisterSelf ¶
RegisterSelf registers this host and writes a key to ~/.kite/kite.key
Click to show internal directories.
Click to hide internal directories.