bapteme

command module
v0.0.0-...-704f572 Latest Latest
Warning

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

Go to latest
Published: Mar 9, 2017 License: Apache-2.0 Imports: 9 Imported by: 0

README

bapteme

Build Status Go Report Card Go Walker

Description

bapteme is a go http server who can be used to named server with a random name.

Use case

Bapteme is mainly used in conjonction with "static" deployment script (preseed, bash, chef, puppet, whatever).

Usage

Server
$ ./bapteme -h
Usage of ./bapteme:
  -bind="": Address to bind. Format IP:PORT
  -d=false: turn on debug info
  -size=10: Default final hostname size
Client
HTTP Parameter Description default
size size of hostname size server command line option
prefix prefix to add on hostname if User-Agent:
win for windows
lin for linux
else srv
instance service to add after prefix
id Unique identifier to generate same hostname
Can be MAC address etc.

Example

Server
$ ./bapteme -bind="127.0.0.1:8086" -size="15"
2014/08/28 16:32:41 INFO Bind to 127.0.0.1:8086
Client
$ curl -X GET 'http://127.0.0.1:8086?size=42'
srvIuKHEt3Kg5ES88kWx8WDCplhzvBM2xEkfRWcNXE
$ curl -X GET 'http://127.0.0.1:8086?size=42'
srvBzi2mhH6y4fKOWXEH9v7EwpYMM4NesXPHY1tseW
$ curl -X GET 'http://127.0.0.1:8086?prefix=rhel&instance=bind&id=01:02:03:04:05:06'
rhelbindMDE6MDI
$ curl -X GET 'http://127.0.0.1:8086?prefix=rhel&instance=bind&id=01:02:03:04:05:06'
rhelbindMDE6MDI
$ curl -X GET 'http://127.0.0.1:8086?prefix=AZERTY&size=2'
name too long
# HTTP 500
# len(AZERTY) >> 2

Documentation

The Go Gopher

There is no documentation for this package.

Jump to

Keyboard shortcuts

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