config

package
v0.4.0 Latest Latest
Warning

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

Go to latest
Published: May 26, 2020 License: MIT Imports: 11 Imported by: 0

Documentation

Overview

Copyright 2019-2020 Axetroy. All rights reserved. MIT license.

Copyright 2019-2020 Axetroy. All rights reserved. MIT license.

Copyright 2019-2020 Axetroy. All rights reserved. MIT license.

Copyright 2019-2020 Axetroy. All rights reserved. MIT license.

Copyright 2019-2020 Axetroy. All rights reserved. MIT license.

Index

Constants

This section is empty.

Variables

View Source
var CreateRouter = router.Handler(func(c router.Context) {
	var body []byte

	body, err := c.GetBody()

	c.ResponseFunc(err, func() schema.Response {
		return Create(helper.NewContext(&c), c.Param("config_name"), body)
	})
})
View Source
var GetListRouter = router.Handler(func(c router.Context) {
	var (
		query Query
	)

	c.ResponseFunc(c.ShouldBindQuery(&query), func() schema.Response {
		return GetList(helper.NewContext(&c), query)
	})
})
View Source
var GetNameRouter = router.Handler(func(c router.Context) {
	c.ResponseFunc(nil, func() schema.Response {
		return GetName(helper.NewContext(&c))
	})
})
View Source
var GetRouter = router.Handler(func(c router.Context) {
	c.ResponseFunc(nil, func() schema.Response {
		return Get(helper.NewContext(&c), c.Param("config_name"))
	})
})
View Source
var UpdateRouter = router.Handler(func(c router.Context) {
	var body []byte

	body, err := c.GetBody()

	c.ResponseFunc(err, func() schema.Response {
		return Update(helper.NewContext(&c), c.Param("config_name"), body)
	})
})

Functions

func Create

func Create(c helper.Context, configName string, fields []byte) (res schema.Response)

func Get

func Get(c helper.Context, configName string) (res schema.Response)

func GetList

func GetList(c helper.Context, q Query) (res schema.Response)

func GetName

func GetName(c helper.Context) (res schema.Response)

func Update

func Update(c helper.Context, configName string, fields []byte) (res schema.Response)

Types

type Query

type Query struct {
	schema.Query
}

Jump to

Keyboard shortcuts

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