airc

module
v0.0.10 Latest Latest
Warning

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

Go to latest
Published: Jul 3, 2024 License: GPL-3.0

README

Air-based utility for live reloading with config building by throwing env variables

Installing

go install github.com/semichkin-gopkg/airc/cmd/airc@v0.0.10

Usage

Build configuration

AIRC_ROOT=/app AIRC_INCLUDE_EXT=go,html airc build -c path/to/output/.air.toml

Run

airc run -c path/to/output/.air.toml

Build and Run

AIRC_ROOT=/app AIRC_INCLUDE_EXT=go,html airc build-run -c path/to/output/.air.toml

Integration with docker

You can use this docker image for building your go application with live reloading.
Configuration for air stored inside a container, and you can modify it with AIRC_... env variables.

Examples
  1. You can omit AIRC variables if your main.go file located in /app/cmd/app/main.go
    version: "3.9"
    services:
      some_go_application:
        image: semichkin/airc:latest
        volumes:
          - ./src/some_go_application:/app
    
  2. If your main.go file located in another place, or you want to change other configuration parameters, you can specify it by AIRC variables
     version: "3.9"
     services:
       some_go_application:
         image: semichkin/airc:latest
         environment:
           - AIRC_ROOT=/some_go_application
           - AIRC_SRC=$$AIRC_ROOT/cmd/api/main.go
           - AIRC_KILL_DELAY=2s
           - ETC=...
         volumes:
           - ./src/some_go_application:/some_go_application
    

Directories

Path Synopsis
cmd
internal
cmd

Jump to

Keyboard shortcuts

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