build

package
v1.1.2 Latest Latest
Warning

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

Go to latest
Published: Jul 30, 2024 License: MIT Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Builder

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

Builder is a structure that provides methods to build the agent and the client.

func New

func New(config *config.Config) *Builder

New creates a new Builder instance with the given configuration. It returns a pointer to the Builder instance.

func (*Builder) AgentApp

func (b *Builder) AgentApp(ctx context.Context) error

AgentApp creates a gRPC client and connects to the server's update service. It returns an error if the connection or the update service call fails.

ctx: The context.Context to use for the gRPC call. Returns: An error if the connection or update service call fails.

func (*Builder) AgentRegisterApp added in v1.1.0

func (b *Builder) AgentRegisterApp(ctx context.Context) error

AgentRegisterApp is a method of the Builder struct.

It registers the agent application with the server. It returns an error if the registration fails.

ctx: The context.Context to use for the gRPC call.

Returns: An error if the registration fails.

func (*Builder) Logger

func (b *Builder) Logger(ctx context.Context) context.Context

Logger creates a new context with a logger attached to it.

It creates a logger with the log level specified in the environment variable LOG_LEVEL. The logger is then attached to the given context.

Parameters:

  • ctx: The context to attach the logger to.

Returns:

  • The context with the logger attached.

Jump to

Keyboard shortcuts

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