# The Library

This doc briefly runs through each package in the `libs/infrastructure-components` library.

## Components

This is for high level abstractions, such as `NewGRPCService`, or `NewHTTPService`.

These use the lower-level components to create a higher level abstraction for a certain infrastructure usecase.

For example, a GRPC service, which is configured to use the Postgres cluster and the Redis cluster automatically, and exposes the gRPC connection on a specified port number.

For now, we only really have a gRPC component and a HTTP component, but we can add more as needed. For example, we could create a Kafka Component.

## Container

This package is for creating Docker container configurations as part of Deployments.

## Deployment

This package is for creating Deployments.

## Docker

This package is for creating and building Docker images. Which the `container` package can utilise.

## Resources

A series of constants for container resources, such as CPU and Memory. These are a few sesible defaults, for example:

```golang
var ResourcesSmall = corev1.ResourceRequirementsArgs{
    Limits: pulumi.StringMap{
        "cpu":    pulumi.String("250m"),
        "memory": pulumi.String("128Mi"),
    },
    Requests: pulumi.StringMap{
        "cpu":    pulumi.String("125m"),
        "memory": pulumi.String("64Mi"),
    },
}
```

## Scaffold

Packages up lower level components, such as `Deployment`, `Container` and `Docker` into a single function, which can be used to create a new service.

This package also starts the Pulumi process, as well as creating a service's config. The `Run` method, takes a yaml config file, as seen and explained in [Creating your first service](/product-docs/libs/infrastructure-components/docs/creating-your-first-service.md).

This is the package you will likely want to use, if you're doing something typical. Such as running a gRPC service with sensible defaults.


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.mediamagic.dev/product-docs/libs/infrastructure-components/docs/the-library.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
