api

package
v0.0.1-tiedot Latest Latest
Warning

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

Go to latest
Published: Oct 22, 2014 License: GPL-3.0 Imports: 3 Imported by: 0

Documentation

Overview

this package acts also as an external api to create custom provisioners

Index

Constants

View Source
const (
	// no slashes for this PrePath in the route
	URL_PRE_ROUTE string = "provisioners"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Provisioner

type Provisioner struct {
	// This name appears in the frontend
	Name string
	// REST path
	Url string
	// can be a fa-* icon or path to an image
	Icon string
	// internal handler
	Api ProvisionerApi
}

func NewProvisioner

func NewProvisioner(n, i string, a ProvisionerApi) *Provisioner

func (*Provisioner) MarshalJSON

func (mj *Provisioner) MarshalJSON() ([]byte, error)

func (*Provisioner) MarshalJSONBuf

func (mj *Provisioner) MarshalJSONBuf(buf *bytes.Buffer) error

type ProvisionerApi

type ProvisionerApi interface {
	// GetRoutes returns the endpoint of the route
	GetRoute() string
	// GetRouteHandler returns a handler which must manage GET, POST and DELETE methods
	// GET returns the config for the <form> fields and also the saved data for the inputs
	// POST saves the data from the input field into the rucksack
	GetRouteHandler() HandlerFunc
}

this methods will be used to query the provisioner instance and set values

type ProvisionerJsonIf

type ProvisionerJsonIf interface {
	MarshalJSON() ([]byte, error)
	MarshalJSONBuf(buf *bytes.Buffer) error
}

type Provisioners

type Provisioners struct {
	Collection []*Provisioner
}

func (*Provisioners) Add

func (p *Provisioners) Add(prov *Provisioner)

func (*Provisioners) Length

func (p *Provisioners) Length() int

func (*Provisioners) MarshalJSON

func (mj *Provisioners) MarshalJSON() ([]byte, error)

func (*Provisioners) MarshalJSONBuf

func (mj *Provisioners) MarshalJSONBuf(buf *bytes.Buffer) error

type ProvisionersJsonIf

type ProvisionersJsonIf interface {
	MarshalJSON() ([]byte, error)
	MarshalJSONBuf(buf *bytes.Buffer) error
}

Jump to

Keyboard shortcuts

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