cmdchannel

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Oct 11, 2022 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Overview

Copyright 2020 New Relic Corporation. All rights reserved. SPDX-License-Identifier: Apache-2.0

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrMsgInvalidArgs = "invalid arguments for command"
	ErrOSNotSupported = errors.New("OS not supported")
)

Errors

Functions

func NewArgsErr

func NewArgsErr(err error) error

NewArgsErr creates an invalid arguments error wrapping the reason

Types

type CmdHandleF

type CmdHandleF func(ctx context.Context, cmd commandapi.Command, initialFetch bool) error

CmdHandleF command channel request handler function.

type CmdHandler

type CmdHandler struct {
	CmdName string     // name of the command request that should be handled
	Handle  CmdHandleF // handling function to be invoked
}

CmdHandler handler for the a given command-channel command request.

func NewCmdHandler

func NewCmdHandler(cmdName string, handle CmdHandleF) *CmdHandler

NewCmdHandler creates a command channel handler.

type InitialCmdResponse

type InitialCmdResponse struct {
	Ts    time.Time
	Delay time.Duration
}

InitialCmdResponse initial command channel response.

type Service

type Service interface {
	InitialFetch(ctx context.Context) (InitialCmdResponse, error)
	Run(ctx context.Context, agentIDProvide id.Provide, initialRes InitialCmdResponse)
}

Service command channel service capable of handling command api cmd requests.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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