Documentation ¶
Index ¶
- Constants
- Variables
- func CorrectHostname(suffix string) (string, error)
- func OverwriteFile(path, content string) error
- func RandString(n int) string
- func SetHostname(name string) error
- type Ambari
- type AmbariConfig
- type Config
- type HostsManager
- type HttpBasicAuth
- type Internal
- type ListClustersResponse
- type RPCClient
- type Request
- type Server
Constants ¶
View Source
const (
DefaultSerfPort = 8201
)
Variables ¶
View Source
var (
DefaultRPCAddr = &net.TCPAddr{IP: net.ParseIP("0.0.0.0"), Port: 8300}
)
View Source
var ErrAmbariCredsError = errors.New("AMBARI_HTTP_AUTH is not set.")
Functions ¶
func CorrectHostname ¶
CorrectHostname ensures that server hostname ends with suffix, and adds random chars before the suffix if we are setting it now.
func OverwriteFile ¶
OverwriteFile overwrites file at *path* with *content*
Types ¶
type Ambari ¶
type Ambari struct {
// contains filtered or unexported fields
}
func (*Ambari) ListClusters ¶
func (a *Ambari) ListClusters() (*ListClustersResponse, error)
type AmbariConfig ¶
type AmbariConfig struct { // Addr is the server url:port Addr string // Auth is the ambari user:password Auth string }
func DefaultAmbariConfig ¶
func DefaultAmbariConfig() (*AmbariConfig, error)
type Config ¶
type Config struct { // Node name is the name we use to advertise. Defaults to hostname. NodeName string // Leader decides if we are the leader Leader bool // SerfConfig is the configuration for serf SerfConfig *serf.Config // RPCAddr describes the RPCAddr *net.TCPAddr // HostsFile points to hosts file. Defaults to /etc/hosts HostsFile string // HostSuffix is os.Hostname suffix HostSuffix string // HostsUpdateInterval decides when to update hosts file HostsUpdateInterval time.Duration // Ambari config AmbariConfig *AmbariConfig }
func DefaultConfig ¶
func MergeConfig ¶
type HostsManager ¶
func NewHostsManager ¶
func NewHostsManager(path string) (*HostsManager, error)
NewHosts parses hosts file at *path*
func (*HostsManager) String ¶
func (h *HostsManager) String() string
type HttpBasicAuth ¶
type HttpBasicAuth struct { // Username to use for HTTP Basic Authentication Username string // Password to use for HTTP Basic Authentication Password string }
HttpBasicAuth is used to authenticate http client with HTTP Basic Authentication
type Internal ¶
type Internal struct {
// contains filtered or unexported fields
}
Internal serves as a endpoint for all internal operations These API's may not be directly exposed to clients
type ListClustersResponse ¶
type RPCClient ¶
type RPCClient struct {
// contains filtered or unexported fields
}
func NewRPCClient ¶
type Request ¶
type Request struct {
// contains filtered or unexported fields
}
Request is used to help build up a request
func NewRequest ¶
Click to show internal directories.
Click to hide internal directories.