api

package
v0.4.8 Latest Latest
Warning

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

Go to latest
Published: Feb 16, 2023 License: GPL-3.0 Imports: 39 Imported by: 0

Documentation

Index

Constants

View Source
const (
	VAR_RUN      = "/var/run"
	GRAVITY_SOCK = "gravity.sock"
)

Variables

View Source
var APITemplate string
View Source
var IndexTemplate string

Functions

func NewLoggingMiddleware

func NewLoggingMiddleware(logger *zap.Logger, after afterHandler) func(h http.Handler) http.Handler

NewLoggingMiddleware provides an http.Handler which logs requests to the HTTP server

func NewRecoverMiddleware

func NewRecoverMiddleware(l *zap.Logger) func(h http.Handler) http.Handler

Types

type APIExportOutput added in v0.3.1

type APIExportOutput struct {
	Entries []APITransportEntry `json:"entries"`
}

type APIImportInput added in v0.3.1

type APIImportInput struct {
	Entries []APITransportEntry `json:"entries"`
}

type APIMember

type APIMember struct {
	ID   uint64 `json:"id"`
	Name string `json:"name"`
}

type APIMemberJoinInput

type APIMemberJoinInput struct {
	Peer       string `json:"peer" maxLength:"255"`
	Roles      string `json:"roles"`
	Identifier string `json:"identifier"`
}

type APIMemberJoinOutput

type APIMemberJoinOutput struct {
	EtcdInitialCluster string `json:"etcdInitialCluster"`
}

type APIMembersOutput

type APIMembersOutput struct {
	Members []APIMember `json:"members"`
}

type APIRoleConfigInput

type APIRoleConfigInput struct {
	Config RoleConfig `json:"config" required:"true"`
}

type APIRoleConfigOutput

type APIRoleConfigOutput struct {
	Config RoleConfig `json:"config" required:"true"`
}

type APIToolPingInput added in v0.3.14

type APIToolPingInput struct {
	Host string `json:"host"`
}

type APIToolPingOutput added in v0.3.14

type APIToolPingOutput struct {
	PacketsRecv           int           `json:"packetsRecv"`
	PacketsSent           int           `json:"packetsSent"`
	PacketsRecvDuplicates int           `json:"packetsRecvDuplicates"`
	PacketLoss            float64       `json:"packetLoss"`
	MinRtt                time.Duration `json:"minRtt"`
	MaxRtt                time.Duration `json:"maxRtt"`
	AvgRtt                time.Duration `json:"avgRtt"`
	StdDevRtt             time.Duration `json:"stdDevRtt"`
}

type APIToolPortmapInput added in v0.3.14

type APIToolPortmapInput struct {
	Host string `json:"host"`
}

type APIToolPortmapOutput added in v0.3.14

type APIToolPortmapOutput struct {
	Ports []APIToolPortmapOutputPort `json:"ports"`
}

type APIToolPortmapOutputPort added in v0.3.14

type APIToolPortmapOutputPort struct {
	Protocol string `json:"protocol"`
	Name     string `json:"name"`
	Reason   string `json:"reason"`
	Port     uint16 `json:"port"`
}

type APIToolTracerouteInput added in v0.3.14

type APIToolTracerouteInput struct {
	Host string `json:"host"`
}

type APIToolTracerouteOutput added in v0.3.14

type APIToolTracerouteOutput struct {
	Hops []APIToolTracerouteOutputHop `json:"hops"`
}

type APIToolTracerouteOutputHop added in v0.3.14

type APIToolTracerouteOutputHop struct {
	Address     string        `json:"address"`
	Success     bool          `json:"success"`
	ElapsedTime time.Duration `json:"elapsedTime"`
}

type APITransportEntry added in v0.3.1

type APITransportEntry struct {
	Key   string `json:"key"`
	Value string `json:"value"`
}

type Role

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

func New

func New(instance roles.Instance) *Role

func (*Role) APIClusterExport added in v0.3.1

func (r *Role) APIClusterExport() usecase.Interactor

func (*Role) APIClusterImport added in v0.3.1

func (r *Role) APIClusterImport() usecase.Interactor

func (*Role) APIClusterJoin

func (r *Role) APIClusterJoin() usecase.Interactor

func (*Role) APIClusterMembers

func (r *Role) APIClusterMembers() usecase.Interactor

func (*Role) APIRoleConfigGet

func (r *Role) APIRoleConfigGet() usecase.Interactor

func (*Role) APIRoleConfigPut

func (r *Role) APIRoleConfigPut() usecase.Interactor

func (*Role) APIToolPing added in v0.3.14

func (r *Role) APIToolPing() usecase.Interactor

func (*Role) APIToolPortmap added in v0.3.14

func (r *Role) APIToolPortmap() usecase.Interactor

func (*Role) APIToolTraceroute added in v0.3.14

func (r *Role) APIToolTraceroute() usecase.Interactor

func (*Role) ListenAndServeHTTP added in v0.3.1

func (r *Role) ListenAndServeHTTP()

func (*Role) ListenAndServeSocket added in v0.3.1

func (r *Role) ListenAndServeSocket()

func (*Role) Ping added in v0.3.14

func (r *Role) Ping(addr string) (*ping.Statistics, error)

func (*Role) Portmap added in v0.3.14

func (r *Role) Portmap(addr string) (nmap.Host, error)

func (*Role) Schema

func (r *Role) Schema(ctx context.Context) *openapi3.Spec

func (*Role) SessionMiddleware

func (r *Role) SessionMiddleware(h http.Handler) http.Handler

func (*Role) SessionStore

func (r *Role) SessionStore() sessions.Store

func (*Role) Start

func (r *Role) Start(ctx context.Context, config []byte) error

func (*Role) Stop

func (r *Role) Stop()

func (*Role) Traceroute added in v0.3.14

func (r *Role) Traceroute(addr string) (traceroute.TracerouteResult, error)

type RoleConfig

type RoleConfig struct {
	Port int32 `json:"port"`
	// Override listen address temporarily, must by JSON accessible as config is passed as JSON
	ListenOverride string            `json:"listenOverride,omitempty"`
	CookieSecret   string            `json:"cookieSecret"`
	OIDC           *types.OIDCConfig `json:"oidc"`
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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