rest-api

command module
v0.0.0-...-3c48df2 Latest Latest
Warning

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

Go to latest
Published: Dec 21, 2023 License: Apache-2.0 Imports: 13 Imported by: 0

README

Choreo Sample REST API - Reading List

Use the following configuration when creating this component in Choreo:
  • Build Preset: Dockerfile
  • Dockerfile Path: go/rest-api/Dockerfile
  • Docker Context Path: go/rest-api

The endpoints.yaml file contains the endpoint configurations that are used by the Choreo to expose the service.

Run the service locally
go run main.go
Generate API definitions

Generated using Go annotations https://github.com/swaggo/swag

  1. Download swag CLI tool by running:

    go install github.com/swaggo/swag/cmd/swag@v1.8.11
    
  2. Run the following command to generate the API definitions:

    swag fmt && swag init
    
Service Configurations (optional)

Refer config.go file for the available configurations.

For more information on how to configure a service in Choreo, refer Manage Configurations and Secrets documentation.

Load initial data ( optional )
  1. Set environment variable by navigating to Choreo Deploy page INIT_DATA_PATH=configs/initial_data.json
  2. Mount the file contents of configs/initial_data.json in the path specified in step 1.

See initial_data.json for a sample file.

Documentation

The Go Gopher

There is no documentation for this package.

Directories

Path Synopsis
api
internal

Jump to

Keyboard shortcuts

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