service

package
v1.1.1 Latest Latest
Warning

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

Go to latest
Published: Nov 3, 2017 License: MIT Imports: 5 Imported by: 0

Documentation

Overview

Copyright 2017 Elliott Polk. All rights reserved. Use of this source code is governed by a MIT-style license that can be found in the LICENSE file.

Index

Constants

View Source
const (
	PathFind   string = "/api/v1/configs"
	PathSet    string = "/api/v1/set"
	PathRemove string = "/api/v1/remove"

	AppParam string = "app"
	EnvParam string = "env"
)

Variables

This section is empty.

Functions

func Find

func Find(w http.ResponseWriter, r *http.Request)
 get is a http.HandleFunc that retrieves the relevant config for the provided
 'app' and 'env' query parameters. An empty 'env' parameter is valid as the
	config.Get will use 'default'. The results are run through json.MarshalIndent
	prior to writing back to the HTTP reponse.

func Remove

func Remove(w http.ResponseWriter, r *http.Request)
 remove is a http.HandleFunc that removes the relevant config for the provided
 'app' and 'env' query parameters. An empty 'env' parameter is valid as the
	config.Remove will use 'default'. If no config exists, no error is returned.
	If the remove occurs properly, a http.StatusOK (200) is returned automatically
	upon return.

func Set

func Set(w http.ResponseWriter, r *http.Request)
 set is a http.HandleFunc that expects a valid config.Config in the request
 body. It attempts to save the config to the datastore, overwriting the existing
 app and environment config if one exists. If the save writes properly, a
	http.StatusOK (200) with the output of what was stored is returned.

Types

This section is empty.

Jump to

Keyboard shortcuts

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