Documentation
¶
Index ¶
- Constants
- Variables
- func GenerateToken() (string, error)
- func HashToken(token string) string
- func VerifyToken(token, encodedHash string) bool
- type Client
- type ClientConfig
- type Command
- type Hub
- func (h *Hub) AttachCommands(connectionID string) (<-chan Command, func())
- func (h *Hub) Authenticate(connectionID, token string) bool
- func (h *Hub) DebugString(connectionID string) string
- func (h *Hub) HandleMessage(connectionID string, message Message)
- func (h *Hub) Inventory(connectionID string) (model.Inventory, bool)
- func (h *Hub) OpenMetricStream(ctx context.Context, connectionID string, request model.MetricRequest, ...) error
- func (h *Hub) OpenStream(ctx context.Context, connectionID string, request model.StreamRequest, ...) error
- func (h *Hub) RefreshInventory(connectionID string) error
- func (h *Hub) Status(connectionID string) model.ConnectionStatus
- type Message
- type RemoteProviderFactory
Constants ¶
View Source
const ProtocolVersion = "1"
Variables ¶
View Source
var Version = "0.1.0"
Functions ¶
func GenerateToken ¶
func VerifyToken ¶
Types ¶
type ClientConfig ¶
type ClientConfig struct {
ServerURL string
ConnectionID string
Token string
Kind string
CAFile string
InsecureSkipVerify bool
InventoryInterval time.Duration
HeartbeatInterval time.Duration
ReconnectMin time.Duration
ReconnectMax time.Duration
Metadata map[string]string
TemporaryTTL time.Duration
}
type Command ¶
type Command struct {
ID string `json:"id"`
Type string `json:"type"`
StreamID string `json:"stream_id,omitempty"`
Request model.StreamRequest `json:"request,omitempty"`
MetricRequest model.MetricRequest `json:"metric_request,omitempty"`
CreatedAt time.Time `json:"created_at"`
}
func NewCommand ¶
type Hub ¶
type Hub struct {
// contains filtered or unexported fields
}
func (*Hub) AttachCommands ¶
func (*Hub) Authenticate ¶
func (*Hub) DebugString ¶
func (*Hub) HandleMessage ¶
func (*Hub) OpenMetricStream ¶
func (h *Hub) OpenMetricStream(ctx context.Context, connectionID string, request model.MetricRequest, out chan<- model.WorkloadMetric) error
func (*Hub) OpenStream ¶
func (h *Hub) OpenStream(ctx context.Context, connectionID string, request model.StreamRequest, out chan<- model.ActivityRecord) error
func (*Hub) RefreshInventory ¶
type Message ¶
type Message struct {
ProtocolVersion string `json:"protocol_version,omitempty"`
Type string `json:"type"`
ConnectionID string `json:"connection_id,omitempty"`
AgentVersion string `json:"agent_version,omitempty"`
AgentKind string `json:"agent_kind,omitempty"`
Metadata map[string]string `json:"metadata,omitempty"`
Inventory *model.Inventory `json:"inventory,omitempty"`
StreamID string `json:"stream_id,omitempty"`
Record *model.ActivityRecord `json:"record,omitempty"`
Metric *model.WorkloadMetric `json:"metric,omitempty"`
Error string `json:"error,omitempty"`
Timestamp time.Time `json:"timestamp"`
}
type RemoteProviderFactory ¶
type RemoteProviderFactory struct{ Hub *Hub }
func (*RemoteProviderFactory) ProviderForAgent ¶
func (f *RemoteProviderFactory) ProviderForAgent(connection model.Connection) (provider.Provider, error)
Click to show internal directories.
Click to hide internal directories.