daemon

package
v0.0.0-...-426bf0d Latest Latest
Warning

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

Go to latest
Published: Jun 26, 2024 License: GPL-3.0 Imports: 16 Imported by: 0

Documentation

Overview

Package daemon is handling the TCP connection and connecting a GRPC service to it.

Index

Constants

View Source
const ERROR_BUFFER_OVERFLOW = daemontestutils.ERROR_BUFFER_OVERFLOW

ERROR_BUFFER_OVERFLOW is the error returned by GetAdaptersAddresses when the buffer is too small.

Variables

This section is empty.

Functions

This section is empty.

Types

type Daemon

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

Daemon is a daemon for windows agents with grpc support.

func New

func New(ctx context.Context, registerGRPCServices GRPCServiceRegisterer, addrDir string) *Daemon

New returns an new, initialized daemon server that is ready to register GRPC services. It hooks up to windows service management handler.

func (Daemon) Quit

func (d Daemon) Quit(ctx context.Context, force bool)

Quit gracefully quits listening loop and stops the grpc server. It can drop any existing connexion if force is true.

func (Daemon) Serve

func (d Daemon) Serve(ctx context.Context, args ...Option) (err error)

Serve listens on a tcp socket and starts serving GRPC requests on it. Before serving, it writes a file on disk on which port it's listening on for client to be able to reach our server. This file is removed once the server stops listening.

type GRPCServiceRegisterer

type GRPCServiceRegisterer func(ctx context.Context) *grpc.Server

GRPCServiceRegisterer is a function that the daemon will call everytime we want to build a new GRPC object.

type Option

type Option func(*options)

Option represents an optional function to override getWslIP default values.

Directories

Path Synopsis
Package daemontestutils exports test helpers to be used in other packages that need to change internal behaviors of the daemon.
Package daemontestutils exports test helpers to be used in other packages that need to change internal behaviors of the daemon.

Jump to

Keyboard shortcuts

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