agent

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Sep 30, 2020 License: GPL-3.0 Imports: 23 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewRPCRequest

func NewRPCRequest(r io.Reader) *rpcRequest

NewRPCRequest returns a new rpcRequest.

func StartJSONRPCServer

func StartJSONRPCServer(a *Agent)

StartJSONRPCServer start a JSONRPC server and waits for connection

Types

type Agent

type Agent struct {
	Name       string
	RetryTimer time.Duration

	AppID uint32

	GRPCConn *grpc.ClientConn

	SdkMgrService struct {
		Client srlndk.SdkMgrServiceClient
	}
	NotificationService struct {
		Client srlndk.SdkNotificationServiceClient
	}
	TelemetryService struct {
		Client srlndk.SdkMgrTelemetryServiceClient
	}
	RouteService struct {
		Client srlndk.SdkMgrRouteServiceClient
	}
	MPLSRouteService struct {
		Client srlndk.SdkMgrMplsRouteServiceClient
	}
	NextHopGroupService struct {
		Client srlndk.SdkMgrNextHopGroupServiceClient
	}
	Config struct {
		YangConfig *yangGit
		// contains filtered or unexported fields
	}

	Github struct {
		Ref  *github.Reference
		Tree *github.Tree
		// contains filtered or unexported fields
	}
}

Agent type

func NewAgent

func NewAgent(ctx context.Context, name string) (*Agent, error)

NewAgent initializes the agent

func (*Agent) CreatePR

func (a *Agent) CreatePR(args *Args, commitBranch *string) (err error)

CreatePR creates a pull request. Based on: https://godoc.org/github.com/google/go-github/github#example-PullRequestsService-Create

func (*Agent) GetRef

func (a *Agent) GetRef(commitBranch *string) (err error)

GetRef function

func (*Agent) GetTree

func (a *Agent) GetTree() (err error)

GetTree function

func (*Agent) GitClient

func (a *Agent) GitClient()

GitClient function

func (*Agent) HandleConfigEvent

func (a *Agent) HandleConfigEvent(op srlndk.SdkMgrOperation, key *srlndk.ConfigKey, data *string)

HandleConfigEvent function

func (*Agent) HandleGitConfigEvent

func (a *Agent) HandleGitConfigEvent(op srlndk.SdkMgrOperation, key *[]string, data *string)

HandleGitConfigEvent function

func (*Agent) KeepAlive

func (a *Agent) KeepAlive(ctx context.Context, period time.Duration)

KeepAlive provides readiness of the Agent

func (*Agent) PushCommit

func (a *Agent) PushCommit(args *Args, ref *github.Reference, tree *github.Tree) (err error)

PushCommit creates the commit in the given reference using the given tree.

func (*Agent) StartAppIDNotificationStream

func (a *Agent) StartAppIDNotificationStream(ctx context.Context, id uint32) chan *srlndk.NotificationStreamResponse

StartAppIDNotificationStream function

func (*Agent) StartBFDSessionNotificationStream

func (a *Agent) StartBFDSessionNotificationStream(ctx context.Context, srcIP, dstIP net.IP, instance uint32) chan *srlndk.NotificationStreamResponse

StartBFDSessionNotificationStream function

func (*Agent) StartConfigNotificationStream

func (a *Agent) StartConfigNotificationStream(ctx context.Context) chan *srlndk.NotificationStreamResponse

StartConfigNotificationStream function

func (*Agent) StartInterfaceNotificationStream

func (a *Agent) StartInterfaceNotificationStream(ctx context.Context, ifName string) chan *srlndk.NotificationStreamResponse

StartInterfaceNotificationStream function

func (*Agent) StartLLDPNeighNotificationStream

func (a *Agent) StartLLDPNeighNotificationStream(ctx context.Context, ifName, chassisType, chassisID string) chan *srlndk.NotificationStreamResponse

StartLLDPNeighNotificationStream function

func (*Agent) StartNwInstNotificationStream

func (a *Agent) StartNwInstNotificationStream(ctx context.Context) chan *srlndk.NotificationStreamResponse

StartNwInstNotificationStream function

func (*Agent) StartRouteNotificationStream

func (a *Agent) StartRouteNotificationStream(ctx context.Context, netInstance string, ipAddr net.IP, prefixLen uint32) chan *srlndk.NotificationStreamResponse

StartRouteNotificationStream function

type Args

type Args struct {
	Subject string
	Comment string
}

Args struct

type HandleFunc

HandleFunc function

type Server

type Server struct {
	Agent *Agent
}

Server struct

func (*Server) Branch

func (s *Server) Branch(args *Args, reply *string) error

Branch function

func (*Server) Commit

func (s *Server) Commit(args *Args, reply *string) error

Commit function

func (*Server) PullRequest

func (s *Server) PullRequest(args *Args, reply *string) error

PullRequest function

Jump to

Keyboard shortcuts

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