Documentation ¶
Overview ¶
Package context is a solution for gathering all required data of the application.
Index ¶
Constants ¶
View Source
const ( // IDEnvVar is the name of the environment variable which contains the current aent ID from the manifest if the aent is a registred instance. IDEnvVar = "PHEROMONE_ID" // ImageEnvVar is the name of the environment variable which contains the current aent image name. ImageEnvVar = "PHEROMONE_IMAGE_NAME" // FromContainerIDEnvVar is the name of the environment variable which contains the sender container ID which has started the recipient image. FromContainerIDEnvVar = "PHEROMONE_FROM_CONTAINER_ID" // HostnameEnvVar is the name of the environment variable which contains the recipient container id. It is populated by Docker. HostnameEnvVar = "HOSTNAME" // HostProjectDirEnvVar is the name of the environment variable which contains the host project directory path. HostProjectDirEnvVar = "PHEROMONE_HOST_PROJECT_DIR" // ContainerProjectDirEnvVar is the name of the environment variable which contains the mounted path of the host project directory. ContainerProjectDirEnvVar = "PHEROMONE_CONTAINER_PROJECT_DIR" // LogLevelEnvVar is the name of the environment variable which contains the log level. LogLevelEnvVar = "PHEROMONE_LOG_LEVEL" )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Context ¶
type Context struct { Image string ID string FromContainerID string Hostname string HostProjectDir string ProjectDir string LogLevel string // contains filtered or unexported fields }
Context is our working struct.
func New ¶
New creates a Context instance according to where is launched the application (form a container or from the host).
func (*Context) IsContainer ¶
IsContainer returns true if the application is launched from a container, false otherwise.
Click to show internal directories.
Click to hide internal directories.