build

package
v1.0.2 Latest Latest
Warning

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

Go to latest
Published: Jul 26, 2024 License: MIT Imports: 15 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 struct that holds the configuration for building the application. It is used to create a new instance of the application.

func NewBuilder

func NewBuilder(config config.Config) (*Builder, error)

NewBuilder creates a new instance of the Builder struct.

It reads the configuration from the environment variables and creates a new instance of the Builder struct with the configuration. If there is an error reading the configuration, it returns the error.

Returns a pointer to the newly created Builder instance and an error if there was an error reading the configuration.

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 configuration file. 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.

func (*Builder) RunGRPCServer

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

RunGRPCServer starts a gRPC server on the TCP port specified by the `GRPCAddr` field of the `config` field of the `Builder` receiver. It listens on the TCP port specified by the `GRPCAddr` field of the `config` field of the `Builder` receiver. If the port is already in use, this function returns an error. It registers the gRPC service implementation with the gRPC server. Then it starts serving requests in a separate goroutine. The function blocks until the server is stopped or an error occurs.

ctx - The context.Context used to stop the server. Returns an error if there is a problem with listening on the TCP port.

func (*Builder) WebhookRepository

func (b *Builder) WebhookRepository() *repositories.WebhookStubRepository

WebhookRepository returns a new instance of the WebhookStubRepository with the webhook data loaded from the configuration.

It uses the webhook data from the configuration to create a new instance of WebhookStubRepository. The webhook data is loaded from the configuration and converted to a map using the AsMap method of the Webhooks type.

Parameters:

  • None

Returns:

  • *repositories.WebhookStubRepository: A new instance of WebhookStubRepository with the webhook data loaded from the configuration.

Jump to

Keyboard shortcuts

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