feat(refacto): move everything in internal package

This allows to install katenary with `go install` and to clean up the
project folder.
This commit is contained in:
2025-08-03 15:54:58 +02:00
parent d1768e5742
commit 14ca5bf0ea
91 changed files with 291 additions and 282 deletions

View File

@@ -0,0 +1,923 @@
<!-- Code generated by gomarkdoc. DO NOT EDIT -->
# generator
```go
import "github.com/katenary/katenary/internal/generator"
```
Package generator generates kubernetes objects from a "compose" file and transforms them into a helm chart.
The generator package is the core of katenary. It is responsible for generating kubernetes objects from a compose file and transforming them into a helm chart. Conversion manipulates Yaml representation of kubernetes object to add conditions, labels, annotations, etc. to the objects. It also create the values to be set to the values.yaml file.
The generate.Convert\(\) create an HelmChart object and call "Generate\(\)" method to convert from a compose file to a helm chart. It saves the helm chart in the given directory.
If you want to change or override the write behavior, you can use the HelmChart.Generate\(\) function and implement your own write function. This function returns the helm chart object containing all kubernetes objects and helm chart ingormation. It does not write the helm chart to the disk.
## Variables
<a name="Annotations"></a>
```go
var (
// Standard annotationss
Annotations = map[string]string{
labels.LabelName("version"): Version,
}
)
```
<a name="Version"></a>Version is the version of katenary. It is set at compile time.
```go
var Version = "master" // changed at compile time
```
<a name="Convert"></a>
## func [Convert](<https://github.com/katenary/katenary/blob/master/internal/generator/converter.go#L100>)
```go
func Convert(config ConvertOptions, dockerComposeFile ...string) error
```
Convert a compose \(docker, podman...\) project to a helm chart. It calls Generate\(\) to generate the chart and then write it to the disk.
<a name="GetLabels"></a>
## func [GetLabels](<https://github.com/katenary/katenary/blob/master/internal/generator/labels.go#L12>)
```go
func GetLabels(serviceName, appName string) map[string]string
```
GetLabels returns the labels for a service. It uses the appName to replace the \_\_replace\_\_ in the labels. This is used to generate the labels in the templates.
<a name="GetMatchLabels"></a>
## func [GetMatchLabels](<https://github.com/katenary/katenary/blob/master/internal/generator/labels.go#L25>)
```go
func GetMatchLabels(serviceName, appName string) map[string]string
```
GetMatchLabels returns the matchLabels for a service. It uses the appName to replace the \_\_replace\_\_ in the labels. This is used to generate the matchLabels in the templates.
<a name="GetVersion"></a>
## func [GetVersion](<https://github.com/katenary/katenary/blob/master/internal/generator/version.go#L14>)
```go
func GetVersion() string
```
GetVersion return the version of katneary. It's important to understand that the version is set at compile time for the github release. But, it the user get katneary using \`go install\`, the version should be different.
<a name="Helper"></a>
## func [Helper](<https://github.com/katenary/katenary/blob/master/internal/generator/helper.go#L15>)
```go
func Helper(name string) string
```
Helper returns the \_helpers.tpl file for a chart.
<a name="NewCronJob"></a>
## func [NewCronJob](<https://github.com/katenary/katenary/blob/master/internal/generator/cronJob.go#L28>)
```go
func NewCronJob(service types.ServiceConfig, chart *HelmChart, appName string) (*CronJob, *RBAC)
```
NewCronJob creates a new CronJob from a compose service. The appName is the name of the application taken from the project name.
<a name="ToK8SYaml"></a>
## func [ToK8SYaml](<https://github.com/katenary/katenary/blob/master/internal/generator/utils.go#L91>)
```go
func ToK8SYaml(obj any) ([]byte, error)
```
<a name="UnWrapTPL"></a>
## func [UnWrapTPL](<https://github.com/katenary/katenary/blob/master/internal/generator/utils.go#L87>)
```go
func UnWrapTPL(in []byte) []byte
```
UnWrapTPL removes the line wrapping from a template.
<a name="ChartTemplate"></a>
## type [ChartTemplate](<https://github.com/katenary/katenary/blob/master/internal/generator/chart.go#L22-L25>)
ChartTemplate is a template of a chart. It contains the content of the template and the name of the service. This is used internally to generate the templates.
```go
type ChartTemplate struct {
Servicename string
Content []byte
}
```
<a name="ConfigMap"></a>
## type [ConfigMap](<https://github.com/katenary/katenary/blob/master/internal/generator/configMap.go#L37-L42>)
ConfigMap is a kubernetes ConfigMap. Implements the DataMap interface.
```go
type ConfigMap struct {
*corev1.ConfigMap
// contains filtered or unexported fields
}
```
<a name="NewConfigMap"></a>
### func [NewConfigMap](<https://github.com/katenary/katenary/blob/master/internal/generator/configMap.go#L46>)
```go
func NewConfigMap(service types.ServiceConfig, appName string, forFile bool) *ConfigMap
```
NewConfigMap creates a new ConfigMap from a compose service. The appName is the name of the application taken from the project name. The ConfigMap is filled by environment variables and labels "map\-env".
<a name="NewConfigMapFromDirectory"></a>
### func [NewConfigMapFromDirectory](<https://github.com/katenary/katenary/blob/master/internal/generator/configMap.go#L119>)
```go
func NewConfigMapFromDirectory(service types.ServiceConfig, appName, path string) *ConfigMap
```
NewConfigMapFromDirectory creates a new ConfigMap from a compose service. This path is the path to the file or directory. If the path is a directory, all files in the directory are added to the ConfigMap. Each subdirectory are ignored. Note that the Generate\(\) function will create the subdirectories ConfigMaps.
<a name="ConfigMap.AddBinaryData"></a>
### func \(\*ConfigMap\) [AddBinaryData](<https://github.com/katenary/katenary/blob/master/internal/generator/configMap.go#L157>)
```go
func (c *ConfigMap) AddBinaryData(key string, value []byte)
```
AddBinaryData adds binary data to the configmap. Append or overwrite the value if the key already exists.
<a name="ConfigMap.AddData"></a>
### func \(\*ConfigMap\) [AddData](<https://github.com/katenary/katenary/blob/master/internal/generator/configMap.go#L152>)
```go
func (c *ConfigMap) AddData(key, value string)
```
AddData adds a key value pair to the configmap. Append or overwrite the value if the key already exists.
<a name="ConfigMap.AppendDir"></a>
### func \(\*ConfigMap\) [AppendDir](<https://github.com/katenary/katenary/blob/master/internal/generator/configMap.go#L166>)
```go
func (c *ConfigMap) AppendDir(path string) error
```
AppendDir adds files from given path to the configmap. It is not recursive, to add all files in a directory, you need to call this function for each subdirectory.
<a name="ConfigMap.AppendFile"></a>
### func \(\*ConfigMap\) [AppendFile](<https://github.com/katenary/katenary/blob/master/internal/generator/configMap.go#L213>)
```go
func (c *ConfigMap) AppendFile(path string) error
```
<a name="ConfigMap.Filename"></a>
### func \(\*ConfigMap\) [Filename](<https://github.com/katenary/katenary/blob/master/internal/generator/configMap.go#L237>)
```go
func (c *ConfigMap) Filename() string
```
Filename returns the filename of the configmap. If the configmap is used for files, the filename contains the path.
<a name="ConfigMap.SetData"></a>
### func \(\*ConfigMap\) [SetData](<https://github.com/katenary/katenary/blob/master/internal/generator/configMap.go#L247>)
```go
func (c *ConfigMap) SetData(data map[string]string)
```
SetData sets the data of the configmap. It replaces the entire data.
<a name="ConfigMap.Yaml"></a>
### func \(\*ConfigMap\) [Yaml](<https://github.com/katenary/katenary/blob/master/internal/generator/configMap.go#L252>)
```go
func (c *ConfigMap) Yaml() ([]byte, error)
```
Yaml returns the yaml representation of the configmap
<a name="ConfigMapMount"></a>
## type [ConfigMapMount](<https://github.com/katenary/katenary/blob/master/internal/generator/deployment.go#L28-L31>)
```go
type ConfigMapMount struct {
// contains filtered or unexported fields
}
```
<a name="ConvertOptions"></a>
## type [ConvertOptions](<https://github.com/katenary/katenary/blob/master/internal/generator/chart.go#L28-L37>)
ConvertOptions are the options to convert a compose project to a helm chart.
```go
type ConvertOptions struct {
AppVersion *string
OutputDir string
ChartVersion string
Icon string
Profiles []string
EnvFiles []string
Force bool
HelmUpdate bool
}
```
<a name="CronJob"></a>
## type [CronJob](<https://github.com/katenary/katenary/blob/master/internal/generator/cronJob.go#L22-L25>)
CronJob is a kubernetes CronJob.
```go
type CronJob struct {
*batchv1.CronJob
// contains filtered or unexported fields
}
```
<a name="CronJob.Filename"></a>
### func \(\*CronJob\) [Filename](<https://github.com/katenary/katenary/blob/master/internal/generator/cronJob.go#L114>)
```go
func (c *CronJob) Filename() string
```
Filename returns the filename of the cronjob.
Implements the Yaml interface.
<a name="CronJob.Yaml"></a>
### func \(\*CronJob\) [Yaml](<https://github.com/katenary/katenary/blob/master/internal/generator/cronJob.go#L121>)
```go
func (c *CronJob) Yaml() ([]byte, error)
```
Yaml returns the yaml representation of the cronjob.
Implements the Yaml interface.
<a name="CronJobValue"></a>
## type [CronJobValue](<https://github.com/katenary/katenary/blob/master/internal/generator/values.go#L118-L123>)
CronJobValue is a cronjob configuration that will be saved in values.yaml.
```go
type CronJobValue struct {
Repository *RepositoryValue `yaml:"repository,omitempty"`
Environment map[string]any `yaml:"environment,omitempty"`
ImagePullPolicy string `yaml:"imagePullPolicy,omitempty"`
Schedule string `yaml:"schedule"`
}
```
<a name="DataMap"></a>
## type [DataMap](<https://github.com/katenary/katenary/blob/master/internal/generator/types.go#L4-L7>)
DataMap is a kubernetes ConfigMap or Secret. It can be used to add data to the ConfigMap or Secret.
```go
type DataMap interface {
SetData(map[string]string)
AddData(string, string)
}
```
<a name="Deployment"></a>
## type [Deployment](<https://github.com/katenary/katenary/blob/master/internal/generator/deployment.go#L34-L44>)
Deployment is a kubernetes Deployment.
```go
type Deployment struct {
*appsv1.Deployment `yaml:",inline"`
// contains filtered or unexported fields
}
```
<a name="NewDeployment"></a>
### func [NewDeployment](<https://github.com/katenary/katenary/blob/master/internal/generator/deployment.go#L48>)
```go
func NewDeployment(service types.ServiceConfig, chart *HelmChart) *Deployment
```
NewDeployment creates a new Deployment from a compose service. The appName is the name of the application taken from the project name. It also creates the Values map that will be used to create the values.yaml file.
<a name="Deployment.AddContainer"></a>
### func \(\*Deployment\) [AddContainer](<https://github.com/katenary/katenary/blob/master/internal/generator/deployment.go#L115>)
```go
func (d *Deployment) AddContainer(service types.ServiceConfig)
```
AddContainer adds a container to the deployment.
<a name="Deployment.AddHealthCheck"></a>
### func \(\*Deployment\) [AddHealthCheck](<https://github.com/katenary/katenary/blob/master/internal/generator/deployment.go#L161>)
```go
func (d *Deployment) AddHealthCheck(service types.ServiceConfig, container *corev1.Container)
```
<a name="Deployment.AddIngress"></a>
### func \(\*Deployment\) [AddIngress](<https://github.com/katenary/katenary/blob/master/internal/generator/deployment.go#L190>)
```go
func (d *Deployment) AddIngress(service types.ServiceConfig, appName string) *Ingress
```
AddIngress adds an ingress to the deployment. It creates the ingress object.
<a name="Deployment.AddLegacyVolume"></a>
### func \(\*Deployment\) [AddLegacyVolume](<https://github.com/katenary/katenary/blob/master/internal/generator/deployment.go#L220>)
```go
func (d *Deployment) AddLegacyVolume(name, kind string)
```
<a name="Deployment.AddVolumes"></a>
### func \(\*Deployment\) [AddVolumes](<https://github.com/katenary/katenary/blob/master/internal/generator/deployment.go#L196>)
```go
func (d *Deployment) AddVolumes(service types.ServiceConfig, appName string)
```
AddVolumes adds a volume to the deployment. It does not create the PVC, it only adds the volumes to the deployment. If the volume is a bind volume it will warn the user that it is not supported yet.
<a name="Deployment.BindFrom"></a>
### func \(\*Deployment\) [BindFrom](<https://github.com/katenary/katenary/blob/master/internal/generator/deployment.go#L241>)
```go
func (d *Deployment) BindFrom(service types.ServiceConfig, binded *Deployment)
```
<a name="Deployment.BindMapFilesToContainer"></a>
### func \(\*Deployment\) [BindMapFilesToContainer](<https://github.com/katenary/katenary/blob/master/internal/generator/deployment.go#L375>)
```go
func (d *Deployment) BindMapFilesToContainer(service types.ServiceConfig, secrets []string, appName string) (*corev1.Container, int)
```
<a name="Deployment.DependsOn"></a>
### func \(\*Deployment\) [DependsOn](<https://github.com/katenary/katenary/blob/master/internal/generator/deployment.go#L269>)
```go
func (d *Deployment) DependsOn(to *Deployment, servicename string) error
```
DependsOn adds a initContainer to the deployment that will wait for the service to be up.
<a name="Deployment.Filename"></a>
### func \(\*Deployment\) [Filename](<https://github.com/katenary/katenary/blob/master/internal/generator/deployment.go#L300>)
```go
func (d *Deployment) Filename() string
```
Filename returns the filename of the deployment.
<a name="Deployment.MountExchangeVolumes"></a>
### func \(\*Deployment\) [MountExchangeVolumes](<https://github.com/katenary/katenary/blob/master/internal/generator/deployment.go#L426>)
```go
func (d *Deployment) MountExchangeVolumes()
```
<a name="Deployment.SetEnvFrom"></a>
### func \(\*Deployment\) [SetEnvFrom](<https://github.com/katenary/katenary/blob/master/internal/generator/deployment.go#L305>)
```go
func (d *Deployment) SetEnvFrom(service types.ServiceConfig, appName string, samePod ...bool)
```
SetEnvFrom sets the environment variables to a configmap. The configmap is created.
<a name="Deployment.Yaml"></a>
### func \(\*Deployment\) [Yaml](<https://github.com/katenary/katenary/blob/master/internal/generator/deployment.go#L450>)
```go
func (d *Deployment) Yaml() ([]byte, error)
```
Yaml returns the yaml representation of the deployment.
<a name="FileMapUsage"></a>
## type [FileMapUsage](<https://github.com/katenary/katenary/blob/master/internal/generator/configMap.go#L21>)
FileMapUsage is the usage of the filemap.
```go
type FileMapUsage uint8
```
<a name="FileMapUsageConfigMap"></a>FileMapUsage constants.
```go
const (
FileMapUsageConfigMap FileMapUsage = iota // pure configmap for key:values.
FileMapUsageFiles // files in a configmap.
)
```
<a name="HelmChart"></a>
## type [HelmChart](<https://github.com/katenary/katenary/blob/master/internal/generator/chart.go#L41-L54>)
HelmChart is a Helm Chart representation. It contains all the templates, values, versions, helpers...
```go
type HelmChart struct {
Templates map[string]*ChartTemplate `yaml:"-"`
Values map[string]any `yaml:"-"`
VolumeMounts map[string]any `yaml:"-"`
Name string `yaml:"name"`
Icon string `yaml:"icon,omitempty"`
APIVersion string `yaml:"apiVersion"`
Version string `yaml:"version"`
AppVersion string `yaml:"appVersion"`
Description string `yaml:"description"`
Helper string `yaml:"-"`
Dependencies []labelstructs.Dependency `yaml:"dependencies,omitempty"`
// contains filtered or unexported fields
}
```
<a name="Generate"></a>
### func [Generate](<https://github.com/katenary/katenary/blob/master/internal/generator/generator.go#L32>)
```go
func Generate(project *types.Project) (*HelmChart, error)
```
Generate a chart from a compose project. This does not write files to disk, it only creates the HelmChart object.
The Generate function will create the HelmChart object this way:
- Detect the service port name or leave the port number if not found.
- Create a deployment for each service that are not ingnore.
- Create a service and ingresses for each service that has ports and/or declared ingresses.
- Create a PVC or Configmap volumes for each volume.
- Create init containers for each service which has dependencies to other services.
- Create a chart dependencies.
- Create a configmap and secrets from the environment variables.
- Merge the same\-pod services.
<a name="NewChart"></a>
### func [NewChart](<https://github.com/katenary/katenary/blob/master/internal/generator/chart.go#L57>)
```go
func NewChart(name string) *HelmChart
```
NewChart creates a new empty chart with the given name.
<a name="HelmChart.SaveTemplates"></a>
### func \(\*HelmChart\) [SaveTemplates](<https://github.com/katenary/katenary/blob/master/internal/generator/chart.go#L72>)
```go
func (chart *HelmChart) SaveTemplates(templateDir string)
```
SaveTemplates the templates of the chart to the given directory.
<a name="Ingress"></a>
## type [Ingress](<https://github.com/katenary/katenary/blob/master/internal/generator/ingress.go#L18-L22>)
```go
type Ingress struct {
*networkv1.Ingress
// contains filtered or unexported fields
}
```
<a name="NewIngress"></a>
### func [NewIngress](<https://github.com/katenary/katenary/blob/master/internal/generator/ingress.go#L25>)
```go
func NewIngress(service types.ServiceConfig, Chart *HelmChart) *Ingress
```
NewIngress creates a new Ingress from a compose service.
<a name="Ingress.Filename"></a>
### func \(\*Ingress\) [Filename](<https://github.com/katenary/katenary/blob/master/internal/generator/ingress.go#L129>)
```go
func (ingress *Ingress) Filename() string
```
<a name="Ingress.Yaml"></a>
### func \(\*Ingress\) [Yaml](<https://github.com/katenary/katenary/blob/master/internal/generator/ingress.go#L133>)
```go
func (ingress *Ingress) Yaml() ([]byte, error)
```
<a name="IngressValue"></a>
## type [IngressValue](<https://github.com/katenary/katenary/blob/master/internal/generator/values.go#L29-L36>)
IngressValue is a ingress configuration that will be saved in values.yaml.
```go
type IngressValue struct {
Annotations map[string]string `yaml:"annotations"`
Host string `yaml:"host"`
Path string `yaml:"path"`
Class string `yaml:"class"`
Enabled bool `yaml:"enabled"`
TLS TLS `yaml:"tls"`
}
```
<a name="PersistenceValue"></a>
## type [PersistenceValue](<https://github.com/katenary/katenary/blob/master/internal/generator/values.go#L16-L21>)
PersistenceValue is a persistence configuration that will be saved in values.yaml.
```go
type PersistenceValue struct {
StorageClass string `yaml:"storageClass"`
Size string `yaml:"size"`
AccessMode []string `yaml:"accessMode"`
Enabled bool `yaml:"enabled"`
}
```
<a name="RBAC"></a>
## type [RBAC](<https://github.com/katenary/katenary/blob/master/internal/generator/rbac.go#L20-L24>)
RBAC is a kubernetes RBAC containing a role, a rolebinding and an associated serviceaccount.
```go
type RBAC struct {
RoleBinding *RoleBinding
Role *Role
ServiceAccount *ServiceAccount
}
```
<a name="NewRBAC"></a>
### func [NewRBAC](<https://github.com/katenary/katenary/blob/master/internal/generator/rbac.go#L27>)
```go
func NewRBAC(service types.ServiceConfig, appName string) *RBAC
```
NewRBAC creates a new RBAC from a compose service. The appName is the name of the application taken from the project name.
<a name="RepositoryValue"></a>
## type [RepositoryValue](<https://github.com/katenary/katenary/blob/master/internal/generator/values.go#L10-L13>)
RepositoryValue is a docker repository image and tag that will be saved in values.yaml.
```go
type RepositoryValue struct {
Image string `yaml:"image"`
Tag string `yaml:"tag"`
}
```
<a name="Role"></a>
## type [Role](<https://github.com/katenary/katenary/blob/master/internal/generator/rbac.go#L114-L117>)
Role is a kubernetes Role.
```go
type Role struct {
*rbacv1.Role
// contains filtered or unexported fields
}
```
<a name="Role.Filename"></a>
### func \(\*Role\) [Filename](<https://github.com/katenary/katenary/blob/master/internal/generator/rbac.go#L119>)
```go
func (r *Role) Filename() string
```
<a name="Role.Yaml"></a>
### func \(\*Role\) [Yaml](<https://github.com/katenary/katenary/blob/master/internal/generator/rbac.go#L123>)
```go
func (r *Role) Yaml() ([]byte, error)
```
<a name="RoleBinding"></a>
## type [RoleBinding](<https://github.com/katenary/katenary/blob/master/internal/generator/rbac.go#L100-L103>)
RoleBinding is a kubernetes RoleBinding.
```go
type RoleBinding struct {
*rbacv1.RoleBinding
// contains filtered or unexported fields
}
```
<a name="RoleBinding.Filename"></a>
### func \(\*RoleBinding\) [Filename](<https://github.com/katenary/katenary/blob/master/internal/generator/rbac.go#L105>)
```go
func (r *RoleBinding) Filename() string
```
<a name="RoleBinding.Yaml"></a>
### func \(\*RoleBinding\) [Yaml](<https://github.com/katenary/katenary/blob/master/internal/generator/rbac.go#L109>)
```go
func (r *RoleBinding) Yaml() ([]byte, error)
```
<a name="Secret"></a>
## type [Secret](<https://github.com/katenary/katenary/blob/master/internal/generator/secret.go#L22-L25>)
Secret is a kubernetes Secret.
Implements the DataMap interface.
```go
type Secret struct {
*corev1.Secret
// contains filtered or unexported fields
}
```
<a name="NewSecret"></a>
### func [NewSecret](<https://github.com/katenary/katenary/blob/master/internal/generator/secret.go#L28>)
```go
func NewSecret(service types.ServiceConfig, appName string) *Secret
```
NewSecret creates a new Secret from a compose service
<a name="Secret.AddData"></a>
### func \(\*Secret\) [AddData](<https://github.com/katenary/katenary/blob/master/internal/generator/secret.go#L70>)
```go
func (s *Secret) AddData(key, value string)
```
AddData adds a key value pair to the secret.
<a name="Secret.Filename"></a>
### func \(\*Secret\) [Filename](<https://github.com/katenary/katenary/blob/master/internal/generator/secret.go#L86>)
```go
func (s *Secret) Filename() string
```
Filename returns the filename of the secret.
<a name="Secret.SetData"></a>
### func \(\*Secret\) [SetData](<https://github.com/katenary/katenary/blob/master/internal/generator/secret.go#L91>)
```go
func (s *Secret) SetData(data map[string]string)
```
SetData sets the data of the secret.
<a name="Secret.Yaml"></a>
### func \(\*Secret\) [Yaml](<https://github.com/katenary/katenary/blob/master/internal/generator/secret.go#L98>)
```go
func (s *Secret) Yaml() ([]byte, error)
```
Yaml returns the yaml representation of the secret.
<a name="Service"></a>
## type [Service](<https://github.com/katenary/katenary/blob/master/internal/generator/service.go#L18-L21>)
Service is a kubernetes Service.
```go
type Service struct {
*v1.Service `yaml:",inline"`
// contains filtered or unexported fields
}
```
<a name="NewService"></a>
### func [NewService](<https://github.com/katenary/katenary/blob/master/internal/generator/service.go#L24>)
```go
func NewService(service types.ServiceConfig, appName string) *Service
```
NewService creates a new Service from a compose service.
<a name="Service.AddPort"></a>
### func \(\*Service\) [AddPort](<https://github.com/katenary/katenary/blob/master/internal/generator/service.go#L53>)
```go
func (s *Service) AddPort(port types.ServicePortConfig, serviceName ...string)
```
AddPort adds a port to the service.
<a name="Service.Filename"></a>
### func \(\*Service\) [Filename](<https://github.com/katenary/katenary/blob/master/internal/generator/service.go#L74>)
```go
func (s *Service) Filename() string
```
Filename returns the filename of the service.
<a name="Service.Yaml"></a>
### func \(\*Service\) [Yaml](<https://github.com/katenary/katenary/blob/master/internal/generator/service.go#L79>)
```go
func (s *Service) Yaml() ([]byte, error)
```
Yaml returns the yaml representation of the service.
<a name="ServiceAccount"></a>
## type [ServiceAccount](<https://github.com/katenary/katenary/blob/master/internal/generator/rbac.go#L132-L135>)
ServiceAccount is a kubernetes ServiceAccount.
```go
type ServiceAccount struct {
*corev1.ServiceAccount
// contains filtered or unexported fields
}
```
<a name="ServiceAccount.Filename"></a>
### func \(\*ServiceAccount\) [Filename](<https://github.com/katenary/katenary/blob/master/internal/generator/rbac.go#L137>)
```go
func (r *ServiceAccount) Filename() string
```
<a name="ServiceAccount.Yaml"></a>
### func \(\*ServiceAccount\) [Yaml](<https://github.com/katenary/katenary/blob/master/internal/generator/rbac.go#L141>)
```go
func (r *ServiceAccount) Yaml() ([]byte, error)
```
<a name="TLS"></a>
## type [TLS](<https://github.com/katenary/katenary/blob/master/internal/generator/values.go#L23-L26>)
```go
type TLS struct {
Enabled bool `yaml:"enabled"`
SecretName string `yaml:"secretName"`
}
```
<a name="Value"></a>
## type [Value](<https://github.com/katenary/katenary/blob/master/internal/generator/values.go#L39-L50>)
Value will be saved in values.yaml. It contains configuration for all deployment and services.
```go
type Value struct {
Repository *RepositoryValue `yaml:"repository,omitempty"`
Persistence map[string]*PersistenceValue `yaml:"persistence,omitempty"`
Ingress *IngressValue `yaml:"ingress,omitempty"`
Environment map[string]any `yaml:"environment,omitempty"`
Replicas *uint32 `yaml:"replicas,omitempty"`
CronJob *CronJobValue `yaml:"cronjob,omitempty"`
NodeSelector map[string]string `yaml:"nodeSelector"`
Resources map[string]any `yaml:"resources"`
ImagePullPolicy string `yaml:"imagePullPolicy,omitempty"`
ServiceAccount string `yaml:"serviceAccount"`
}
```
<a name="NewValue"></a>
### func [NewValue](<https://github.com/katenary/katenary/blob/master/internal/generator/values.go#L57>)
```go
func NewValue(service types.ServiceConfig, main ...bool) *Value
```
NewValue creates a new Value from a compose service. The value contains the necessary information to deploy the service \(image, tag, replicas, etc.\).
If \`main\` is true, the tag will be empty because it will be set in the helm chart appVersion.
<a name="Value.AddIngress"></a>
### func \(\*Value\) [AddIngress](<https://github.com/katenary/katenary/blob/master/internal/generator/values.go#L90>)
```go
func (v *Value) AddIngress(host, path string)
```
<a name="Value.AddPersistence"></a>
### func \(\*Value\) [AddPersistence](<https://github.com/katenary/katenary/blob/master/internal/generator/values.go#L104>)
```go
func (v *Value) AddPersistence(volumeName string)
```
AddPersistence adds persistence configuration to the Value.
<a name="VolumeClaim"></a>
## type [VolumeClaim](<https://github.com/katenary/katenary/blob/master/internal/generator/volume.go#L18-L23>)
VolumeClaim is a kubernetes VolumeClaim. This is a PersistentVolumeClaim.
```go
type VolumeClaim struct {
*v1.PersistentVolumeClaim
// contains filtered or unexported fields
}
```
<a name="NewVolumeClaim"></a>
### func [NewVolumeClaim](<https://github.com/katenary/katenary/blob/master/internal/generator/volume.go#L26>)
```go
func NewVolumeClaim(service types.ServiceConfig, volumeName, appName string) *VolumeClaim
```
NewVolumeClaim creates a new VolumeClaim from a compose service.
<a name="VolumeClaim.Filename"></a>
### func \(\*VolumeClaim\) [Filename](<https://github.com/katenary/katenary/blob/master/internal/generator/volume.go#L62>)
```go
func (v *VolumeClaim) Filename() string
```
Filename returns the suggested filename for a VolumeClaim.
<a name="VolumeClaim.Yaml"></a>
### func \(\*VolumeClaim\) [Yaml](<https://github.com/katenary/katenary/blob/master/internal/generator/volume.go#L67>)
```go
func (v *VolumeClaim) Yaml() ([]byte, error)
```
Yaml marshals a VolumeClaim into yaml.
<a name="Yaml"></a>
## type [Yaml](<https://github.com/katenary/katenary/blob/master/internal/generator/types.go#L10-L13>)
Yaml is a kubernetes object that can be converted to yaml.
```go
type Yaml interface {
Yaml() ([]byte, error)
Filename() string
}
```
Generated by [gomarkdoc](<https://github.com/princjef/gomarkdoc>)

View File

@@ -0,0 +1,28 @@
<!-- Code generated by gomarkdoc. DO NOT EDIT -->
# extrafiles
```go
import "github.com/katenary/katenary/internal/generator/extrafiles"
```
Package extrafiles provides function to generate the Chart files that are not objects. Like README.md and notes.txt...
## func [NotesFile](<https://github.com/katenary/katenary/blob/master/internal/generator/extrafiles/notes.go#L13>)
```go
func NotesFile(services []string) string
```
NotesFile returns the content of the note.txt file.
<a name="ReadMeFile"></a>
## func [ReadMeFile](<https://github.com/katenary/katenary/blob/master/internal/generator/extrafiles/readme.go#L46>)
```go
func ReadMeFile(charname, description string, values map[string]any) string
```
ReadMeFile returns the content of the README.md file.
Generated by [gomarkdoc](<https://github.com/princjef/gomarkdoc>)

View File

@@ -0,0 +1,67 @@
<!-- Code generated by gomarkdoc. DO NOT EDIT -->
# katenaryfile
```go
import "github.com/katenary/katenary/internal/generator/katenaryfile"
```
Package katenaryfile is a package for reading and writing katenary files.
A katenary file, named "katenary.yml" or "katenary.yaml", is a file where you can define the configuration of the conversion avoiding the use of labels in the compose file.
Formely, the file describe the same structure as in labels, and so that can be validated and completed by LSP. It also ease the use of katenary.
## func [GenerateSchema](<https://github.com/katenary/katenary/blob/master/internal/generator/katenaryfile/main.go#L137>)
```go
func GenerateSchema() string
```
GenerateSchema generates the schema for the katenary.yaml file.
<a name="OverrideWithConfig"></a>
## func [OverrideWithConfig](<https://github.com/katenary/katenary/blob/master/internal/generator/katenaryfile/main.go#L49>)
```go
func OverrideWithConfig(project *types.Project)
```
OverrideWithConfig overrides the project with the katenary.yaml file. It will set the labels of the services with the values from the katenary.yaml file. It work in memory, so it will not modify the original project.
<a name="Service"></a>
## type [Service](<https://github.com/katenary/katenary/blob/master/internal/generator/katenaryfile/main.go#L27-L44>)
Service is a struct that contains the service configuration for katenary
```go
type Service struct {
MainApp *bool `yaml:"main-app,omitempty" json:"main-app,omitempty" jsonschema:"title=Is this service the main application"`
Values []StringOrMap `yaml:"values,omitempty" json:"values,omitempty" jsonschema:"description=Environment variables to be set in values.yaml with or without a description"`
Secrets *labelstructs.Secrets `yaml:"secrets,omitempty" json:"secrets,omitempty" jsonschema:"title=Secrets,description=Environment variables to be set as secrets"`
Ports *labelstructs.Ports `yaml:"ports,omitempty" json:"ports,omitempty" jsonschema:"title=Ports,description=Ports to be exposed in services"`
Ingress *labelstructs.Ingress `yaml:"ingress,omitempty" json:"ingress,omitempty" jsonschema:"title=Ingress,description=Ingress configuration"`
HealthCheck *labelstructs.HealthCheck `yaml:"health-check,omitempty" json:"health-check,omitempty" jsonschema:"title=Health Check,description=Health check configuration that respects the kubernetes api"`
SamePod *string `yaml:"same-pod,omitempty" json:"same-pod,omitempty" jsonschema:"title=Same Pod,description=Service that should be in the same pod"`
Description *string `yaml:"description,omitempty" json:"description,omitempty" jsonschema:"title=Description,description=Description of the service that will be injected in the values.yaml file"`
Ignore *bool `yaml:"ignore,omitempty" json:"ignore,omitempty" jsonschema:"title=Ignore,description=Ignore the service in the conversion"`
Dependencies []labelstructs.Dependency `yaml:"dependencies,omitempty" json:"dependencies,omitempty" jsonschema:"title=Dependencies,description=Services that should be injected in the Chart.yaml file"`
ConfigMapFiles *labelstructs.ConfigMapFiles `yaml:"configmap-files,omitempty" json:"configmap-files,omitempty" jsonschema:"title=ConfigMap Files,description=Files that should be injected as ConfigMap"`
MapEnv *labelstructs.MapEnv `yaml:"map-env,omitempty" json:"map-env,omitempty" jsonschema:"title=Map Env,description=Map environment variables to another value"`
CronJob *labelstructs.CronJob `yaml:"cron-job,omitempty" json:"cron-job,omitempty" jsonschema:"title=Cron Job,description=Cron Job configuration"`
EnvFrom *labelstructs.EnvFrom `yaml:"env-from,omitempty" json:"env-from,omitempty" jsonschema:"title=Env From,description=Inject environment variables from another service"`
ExchangeVolumes []*labelstructs.ExchangeVolume `yaml:"exchange-volumes,omitempty" json:"exchange-volumes,omitempty" jsonschema:"title=Exchange Volumes,description=Exchange volumes between services"`
ValuesFrom *labelstructs.ValueFrom `yaml:"values-from,omitempty" json:"values-from,omitempty" jsonschema:"title=Values From,description=Inject values from another service (secret or configmap environment variables)"`
}
```
<a name="StringOrMap"></a>
## type [StringOrMap](<https://github.com/katenary/katenary/blob/master/internal/generator/katenaryfile/main.go#L24>)
StringOrMap is a struct that can be either a string or a map of strings. It's a helper struct to unmarshal the katenary.yaml file and produce the schema
```go
type StringOrMap any
```
Generated by [gomarkdoc](<https://github.com/princjef/gomarkdoc>)

View File

@@ -0,0 +1,110 @@
<!-- Code generated by gomarkdoc. DO NOT EDIT -->
# labels
```go
import "github.com/katenary/katenary/internal/generator/labels"
```
Package labels provides functionality to parse and manipulate labels.
## Constants
<a name="KatenaryLabelPrefix"></a>
```go
const KatenaryLabelPrefix = "katenary.v3"
```
<a name="GetLabelHelp"></a>
## func [GetLabelHelp](<https://github.com/katenary/katenary/blob/master/internal/generator/labels/katenaryLabels.go#L88>)
```go
func GetLabelHelp(asMarkdown bool) string
```
GetLabelHelp return the help for the labels.
<a name="GetLabelHelpFor"></a>
## func [GetLabelHelpFor](<https://github.com/katenary/katenary/blob/master/internal/generator/labels/katenaryLabels.go#L97>)
```go
func GetLabelHelpFor(labelname string, asMarkdown bool) string
```
GetLabelHelpFor returns the help for a specific label.
<a name="GetLabelNames"></a>
## func [GetLabelNames](<https://github.com/katenary/katenary/blob/master/internal/generator/labels/katenaryLabels.go#L72>)
```go
func GetLabelNames() []string
```
GetLabelNames returns a sorted list of all katenary label names.
<a name="Prefix"></a>
## func [Prefix](<https://github.com/katenary/katenary/blob/master/internal/generator/labels/katenaryLabels.go#L235>)
```go
func Prefix() string
```
<a name="Help"></a>
## type [Help](<https://github.com/katenary/katenary/blob/master/internal/generator/labels/katenaryLabels.go#L64-L69>)
Help is the documentation of a label.
```go
type Help struct {
Short string `yaml:"short"`
Long string `yaml:"long"`
Example string `yaml:"example"`
Type string `yaml:"type"`
}
```
<a name="Label"></a>
## type [Label](<https://github.com/katenary/katenary/blob/master/internal/generator/labels/katenaryLabels.go#L57>)
Label is a katenary label to find in compose files.
```go
type Label = string
```
<a name="LabelMainApp"></a>Known labels.
```go
const (
LabelMainApp Label = KatenaryLabelPrefix + "/main-app"
LabelValues Label = KatenaryLabelPrefix + "/values"
LabelSecrets Label = KatenaryLabelPrefix + "/secrets"
LabelPorts Label = KatenaryLabelPrefix + "/ports"
LabelIngress Label = KatenaryLabelPrefix + "/ingress"
LabelMapEnv Label = KatenaryLabelPrefix + "/map-env"
LabelHealthCheck Label = KatenaryLabelPrefix + "/health-check"
LabelSamePod Label = KatenaryLabelPrefix + "/same-pod"
LabelDescription Label = KatenaryLabelPrefix + "/description"
LabelIgnore Label = KatenaryLabelPrefix + "/ignore"
LabelDependencies Label = KatenaryLabelPrefix + "/dependencies"
LabelConfigMapFiles Label = KatenaryLabelPrefix + "/configmap-files"
LabelCronJob Label = KatenaryLabelPrefix + "/cronjob"
LabelEnvFrom Label = KatenaryLabelPrefix + "/env-from"
LabelExchangeVolume Label = KatenaryLabelPrefix + "/exchange-volumes"
LabelValuesFrom Label = KatenaryLabelPrefix + "/values-from"
)
```
<a name="LabelName"></a>
### func [LabelName](<https://github.com/katenary/katenary/blob/master/internal/generator/labels/katenaryLabels.go#L59>)
```go
func LabelName(name string) Label
```
Generated by [gomarkdoc](<https://github.com/princjef/gomarkdoc>)

View File

@@ -0,0 +1,246 @@
<!-- Code generated by gomarkdoc. DO NOT EDIT -->
# labelstructs
```go
import "github.com/katenary/katenary/internal/generator/labels/labelstructs"
```
Package labelstructs is a package that contains the structs used to represent the labels in the yaml files.
## type [ConfigMapFiles](<https://github.com/katenary/katenary/blob/master/internal/generator/labels/labelstructs/configMap.go#L5>)
```go
type ConfigMapFiles []string
```
<a name="ConfigMapFileFrom"></a>
### func [ConfigMapFileFrom](<https://github.com/katenary/katenary/blob/master/internal/generator/labels/labelstructs/configMap.go#L7>)
```go
func ConfigMapFileFrom(data string) (ConfigMapFiles, error)
```
<a name="CronJob"></a>
## type [CronJob](<https://github.com/katenary/katenary/blob/master/internal/generator/labels/labelstructs/cronJob.go#L5-L10>)
```go
type CronJob struct {
Image string `yaml:"image,omitempty" json:"image,omitempty"`
Command string `yaml:"command" json:"command,omitempty"`
Schedule string `yaml:"schedule" json:"schedule,omitempty"`
Rbac bool `yaml:"rbac" json:"rbac,omitempty"`
}
```
<a name="CronJobFrom"></a>
### func [CronJobFrom](<https://github.com/katenary/katenary/blob/master/internal/generator/labels/labelstructs/cronJob.go#L12>)
```go
func CronJobFrom(data string) (*CronJob, error)
```
<a name="Dependency"></a>
## type [Dependency](<https://github.com/katenary/katenary/blob/master/internal/generator/labels/labelstructs/dependencies.go#L6-L12>)
Dependency is a dependency of a chart to other charts.
```go
type Dependency struct {
Values map[string]any `yaml:"-" json:"values,omitempty"`
Name string `yaml:"name" json:"name"`
Version string `yaml:"version" json:"version"`
Repository string `yaml:"repository" json:"repository"`
Alias string `yaml:"alias,omitempty" json:"alias,omitempty"`
}
```
<a name="DependenciesFrom"></a>
### func [DependenciesFrom](<https://github.com/katenary/katenary/blob/master/internal/generator/labels/labelstructs/dependencies.go#L15>)
```go
func DependenciesFrom(data string) ([]Dependency, error)
```
DependenciesFrom returns a slice of dependencies from the given string.
<a name="EnvFrom"></a>
## type [EnvFrom](<https://github.com/katenary/katenary/blob/master/internal/generator/labels/labelstructs/envFrom.go#L5>)
```go
type EnvFrom []string
```
<a name="EnvFromFrom"></a>
### func [EnvFromFrom](<https://github.com/katenary/katenary/blob/master/internal/generator/labels/labelstructs/envFrom.go#L8>)
```go
func EnvFromFrom(data string) (EnvFrom, error)
```
EnvFromFrom returns a EnvFrom from the given string.
<a name="ExchangeVolume"></a>
## type [ExchangeVolume](<https://github.com/katenary/katenary/blob/master/internal/generator/labels/labelstructs/exchangeVolume.go#L5-L10>)
```go
type ExchangeVolume struct {
Name string `yaml:"name" json:"name"`
MountPath string `yaml:"mountPath" json:"mountPath"`
Type string `yaml:"type,omitempty" json:"type,omitempty"`
Init string `yaml:"init,omitempty" json:"init,omitempty"`
}
```
<a name="NewExchangeVolumes"></a>
### func [NewExchangeVolumes](<https://github.com/katenary/katenary/blob/master/internal/generator/labels/labelstructs/exchangeVolume.go#L12>)
```go
func NewExchangeVolumes(data string) ([]*ExchangeVolume, error)
```
<a name="HealthCheck"></a>
## type [HealthCheck](<https://github.com/katenary/katenary/blob/master/internal/generator/labels/labelstructs/probes.go#L11-L14>)
```go
type HealthCheck struct {
LivenessProbe *corev1.Probe `yaml:"livenessProbe,omitempty" json:"livenessProbe,omitempty"`
ReadinessProbe *corev1.Probe `yaml:"readinessProbe,omitempty" json:"readinessProbe,omitempty"`
}
```
<a name="ProbeFrom"></a>
### func [ProbeFrom](<https://github.com/katenary/katenary/blob/master/internal/generator/labels/labelstructs/probes.go#L16>)
```go
func ProbeFrom(data string) (*HealthCheck, error)
```
<a name="Ingress"></a>
## type [Ingress](<https://github.com/katenary/katenary/blob/master/internal/generator/labels/labelstructs/ingress.go#L14-L22>)
```go
type Ingress struct {
Port *int32 `yaml:"port,omitempty" json:"port,omitempty"`
Annotations map[string]string `yaml:"annotations,omitempty" jsonschema:"nullable" json:"annotations,omitempty"`
Hostname string `yaml:"hostname,omitempty" json:"hostname,omitempty"`
Path *string `yaml:"path,omitempty" json:"path,omitempty"`
Class *string `yaml:"class,omitempty" json:"class,omitempty" jsonschema:"default:-"`
Enabled bool `yaml:"enabled,omitempty" json:"enabled,omitempty"`
TLS *TLS `yaml:"tls,omitempty" json:"tls,omitempty"`
}
```
<a name="IngressFrom"></a>
### func [IngressFrom](<https://github.com/katenary/katenary/blob/master/internal/generator/labels/labelstructs/ingress.go#L25>)
```go
func IngressFrom(data string) (*Ingress, error)
```
IngressFrom creates a new Ingress from a compose service.
<a name="MapEnv"></a>
## type [MapEnv](<https://github.com/katenary/katenary/blob/master/internal/generator/labels/labelstructs/mapenv.go#L5>)
```go
type MapEnv map[string]string
```
<a name="MapEnvFrom"></a>
### func [MapEnvFrom](<https://github.com/katenary/katenary/blob/master/internal/generator/labels/labelstructs/mapenv.go#L8>)
```go
func MapEnvFrom(data string) (MapEnv, error)
```
MapEnvFrom returns a MapEnv from the given string.
<a name="Ports"></a>
## type [Ports](<https://github.com/katenary/katenary/blob/master/internal/generator/labels/labelstructs/ports.go#L5>)
```go
type Ports []uint32
```
<a name="PortsFrom"></a>
### func [PortsFrom](<https://github.com/katenary/katenary/blob/master/internal/generator/labels/labelstructs/ports.go#L8>)
```go
func PortsFrom(data string) (Ports, error)
```
PortsFrom returns a Ports from the given string.
<a name="Secrets"></a>
## type [Secrets](<https://github.com/katenary/katenary/blob/master/internal/generator/labels/labelstructs/secrets.go#L5>)
```go
type Secrets []string
```
<a name="SecretsFrom"></a>
### func [SecretsFrom](<https://github.com/katenary/katenary/blob/master/internal/generator/labels/labelstructs/secrets.go#L7>)
```go
func SecretsFrom(data string) (Secrets, error)
```
<a name="TLS"></a>
## type [TLS](<https://github.com/katenary/katenary/blob/master/internal/generator/labels/labelstructs/ingress.go#L10-L12>)
```go
type TLS struct {
Enabled bool `yaml:"enabled" json:"enabled,omitempty"`
}
```
<a name="ValueFrom"></a>
## type [ValueFrom](<https://github.com/katenary/katenary/blob/master/internal/generator/labels/labelstructs/valueFrom.go#L5>)
```go
type ValueFrom map[string]string
```
<a name="GetValueFrom"></a>
### func [GetValueFrom](<https://github.com/katenary/katenary/blob/master/internal/generator/labels/labelstructs/valueFrom.go#L7>)
```go
func GetValueFrom(data string) (*ValueFrom, error)
```
Generated by [gomarkdoc](<https://github.com/princjef/gomarkdoc>)

View File

@@ -0,0 +1,19 @@
<!-- Code generated by gomarkdoc. DO NOT EDIT -->
# parser
```go
import "github.com/katenary/katenary/internal/parser"
```
Package parser is a wrapper around compose\-go to parse compose files.
## func [Parse](<https://github.com/katenary/katenary/blob/master/internal/parser/main.go#L29>)
```go
func Parse(profiles []string, envFiles []string, dockerComposeFile ...string) (*types.Project, error)
```
Parse compose files and return a project. The project is parsed with dotenv, osenv and profiles.
Generated by [gomarkdoc](<https://github.com/princjef/gomarkdoc>)

View File

@@ -0,0 +1,221 @@
<!-- Code generated by gomarkdoc. DO NOT EDIT -->
# utils
```go
import "github.com/katenary/katenary/internal/utils"
```
Package utils provides some utility functions used in katenary. It defines some constants and functions used in the whole project.
## Constants
<a name="DirectoryPermission"></a>DirectoryPermission is the default values for permissions apply to created directories.
```go
const DirectoryPermission = 0o755
```
<a name="AsResourceName"></a>
## func [AsResourceName](<https://github.com/katenary/katenary/blob/master/internal/utils/utils.go#L196>)
```go
func AsResourceName(name string) string
```
AsResourceName returns a resource name with underscores to respect the kubernetes naming convention. It's the opposite of FixedResourceName.
<a name="Confirm"></a>
## func [Confirm](<https://github.com/katenary/katenary/blob/master/internal/utils/utils.go#L164>)
```go
func Confirm(question string, icon ...Icon) bool
```
Confirm asks a question and returns true if the answer is y.
<a name="CountStartingSpaces"></a>
## func [CountStartingSpaces](<https://github.com/katenary/katenary/blob/master/internal/utils/utils.go#L41>)
```go
func CountStartingSpaces(line string) int
```
CountStartingSpaces counts the number of spaces at the beginning of a string.
<a name="EncodeBasicYaml"></a>
## func [EncodeBasicYaml](<https://github.com/katenary/katenary/blob/master/internal/utils/utils.go#L178>)
```go
func EncodeBasicYaml(data any) ([]byte, error)
```
EncodeBasicYaml encodes a basic yaml from an interface.
<a name="FixedResourceName"></a>
## func [FixedResourceName](<https://github.com/katenary/katenary/blob/master/internal/utils/utils.go#L190>)
```go
func FixedResourceName(name string) string
```
FixedResourceName returns a resource name without underscores to respect the kubernetes naming convention.
<a name="GetContainerByName"></a>
## func [GetContainerByName](<https://github.com/katenary/katenary/blob/master/internal/utils/utils.go#L87>)
```go
func GetContainerByName(name string, containers []corev1.Container) (*corev1.Container, int)
```
GetContainerByName returns a container by name and its index in the array. It returns nil, \-1 if not found.
<a name="GetKind"></a>
## func [GetKind](<https://github.com/katenary/katenary/blob/master/internal/utils/utils.go#L54>)
```go
func GetKind(path string) (kind string)
```
GetKind returns the kind of the resource from the file path.
<a name="GetServiceNameByPort"></a>
## func [GetServiceNameByPort](<https://github.com/katenary/katenary/blob/master/internal/utils/utils.go#L77>)
```go
func GetServiceNameByPort(port int) string
```
GetServiceNameByPort returns the service name for a port. It the service name is not found, it returns an empty string.
<a name="GetValuesFromLabel"></a>
## func [GetValuesFromLabel](<https://github.com/katenary/katenary/blob/master/internal/utils/utils.go#L129>)
```go
func GetValuesFromLabel(service types.ServiceConfig, LabelValues string) map[string]*EnvConfig
```
GetValuesFromLabel returns a map of values from a label.
<a name="HashComposefiles"></a>
## func [HashComposefiles](<https://github.com/katenary/katenary/blob/master/internal/utils/hash.go#L12>)
```go
func HashComposefiles(files []string) (string, error)
```
HashComposefiles returns a hash of the compose files.
<a name="Int32Ptr"></a>
## func [Int32Ptr](<https://github.com/katenary/katenary/blob/master/internal/utils/utils.go#L35>)
```go
func Int32Ptr(i int32) *int32
```
Int32Ptr returns a pointer to an int32.
<a name="PathToName"></a>
## func [PathToName](<https://github.com/katenary/katenary/blob/master/internal/utils/utils.go#L106>)
```go
func PathToName(path string) string
```
PathToName converts a path to a kubernetes complient name.
<a name="StrPtr"></a>
## func [StrPtr](<https://github.com/katenary/katenary/blob/master/internal/utils/utils.go#L38>)
```go
func StrPtr(s string) *string
```
StrPtr returns a pointer to a string.
<a name="TplName"></a>
## func [TplName](<https://github.com/katenary/katenary/blob/master/internal/utils/utils.go#L22>)
```go
func TplName(serviceName, appname string, suffix ...string) string
```
TplName returns the name of the kubernetes resource as a template string. It is used in the templates and defined in \_helper.tpl file.
<a name="TplValue"></a>
## func [TplValue](<https://github.com/katenary/katenary/blob/master/internal/utils/utils.go#L97>)
```go
func TplValue(serviceName, variable string, pipes ...string) string
```
TplValue returns a string that can be used in a template to access a value from the values file.
<a name="Warn"></a>
## func [Warn](<https://github.com/katenary/katenary/blob/master/internal/utils/icons.go#L25>)
```go
func Warn(msg ...any)
```
Warn prints a warning message
<a name="WordWrap"></a>
## func [WordWrap](<https://github.com/katenary/katenary/blob/master/internal/utils/utils.go#L159>)
```go
func WordWrap(text string, lineWidth int) string
```
WordWrap wraps a string to a given line width. Warning: it may break the string. You need to check the result.
<a name="Wrap"></a>
## func [Wrap](<https://github.com/katenary/katenary/blob/master/internal/utils/utils.go#L71>)
```go
func Wrap(src, above, below string) string
```
Wrap wraps a string with a string above and below. It will respect the indentation of the src string.
<a name="EnvConfig"></a>
## type [EnvConfig](<https://github.com/katenary/katenary/blob/master/internal/utils/utils.go#L123-L126>)
EnvConfig is a struct to hold the description of an environment variable.
```go
type EnvConfig struct {
Service types.ServiceConfig
Description string
}
```
<a name="Icon"></a>
## type [Icon](<https://github.com/katenary/katenary/blob/master/internal/utils/icons.go#L6>)
Icon is a unicode icon
```go
type Icon string
```
<a name="IconSuccess"></a>Icons used in katenary.
```go
const (
IconSuccess Icon = "✅"
IconFailure Icon = "❌"
IconWarning Icon = "❕"
IconNote Icon = "📝"
IconWorld Icon = "🌐"
IconPlug Icon = "🔌"
IconPackage Icon = "📦"
IconCabinet Icon = "🗄️"
IconInfo Icon = "🔵"
IconSecret Icon = "🔒"
IconConfig Icon = "🔧"
IconDependency Icon = "🔗"
)
```
Generated by [gomarkdoc](<https://github.com/princjef/gomarkdoc>)