contivModel

package
v0.0.0-...-6e59425 Latest Latest
Warning

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

Go to latest
Published: Oct 27, 2017 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AddRoutes

func AddRoutes(router *mux.Router)

Add all routes for REST handlers

func CreateNetwork

func CreateNetwork(obj *Network) error

Create a network object

func CreateTenant

func CreateTenant(obj *Tenant) error

Create a tenant object

func DeleteNetwork

func DeleteNetwork(key string) error

Delete a network object

func DeleteTenant

func DeleteTenant(key string) error

Delete a tenant object

func Init

func Init()

func RegisterNetworkCallbacks

func RegisterNetworkCallbacks(handler NetworkCallbacks)

func RegisterTenantCallbacks

func RegisterTenantCallbacks(handler TenantCallbacks)

func ValidateNetwork

func ValidateNetwork(obj *Network) error

Validate a network object

func ValidateTenant

func ValidateTenant(obj *Tenant) error

Validate a tenant object

Types

type CallbackHandlers

type CallbackHandlers struct {
	NetworkCb NetworkCallbacks
	TenantCb  TenantCallbacks
}

type Collections

type Collections struct {
	// contains filtered or unexported fields
}

type HttpApiFunc

type HttpApiFunc func(w http.ResponseWriter, r *http.Request, vars map[string]string) (interface{}, error)

type Network

type Network struct {
	// every object has a key
	Key string `json:"key,omitempty"`

	Encap       string   `json:"encap,omitempty"`
	IsPrivate   bool     `json:"isPrivate,omitempty"`
	IsPublic    bool     `json:"isPublic,omitempty"`
	Labels      []string `json:"labels,omitempty"`
	NetworkName string   `json:"networkName,omitempty"`
	PktTag      int      `json:"pktTag,omitempty"`
	Subnet      string   `json:"subnet,omitempty"`
	TenantName  string   `json:"tenantName,omitempty"`

	Links NetworkLinks `json:"links,omitempty"`
}

func FindNetwork

func FindNetwork(key string) *Network

Return a pointer to network from collection

func (*Network) Delete

func (self *Network) Delete() error

func (*Network) GetKey

func (self *Network) GetKey() string

func (*Network) GetType

func (self *Network) GetType() string

func (*Network) Read

func (self *Network) Read() error

func (*Network) Write

func (self *Network) Write() error

type NetworkCallbacks

type NetworkCallbacks interface {
	NetworkCreate(network *Network) error
	NetworkUpdate(network, params *Network) error
	NetworkDelete(network *Network) error
}
type NetworkLinks struct {
	Tenant modeldb.Link `json:"Tenant,omitempty"`
}

type Tenant

type Tenant struct {
	// every object has a key
	Key string `json:"key,omitempty"`

	TenantName string `json:"tenantName,omitempty"`

	// add link-sets and links
	LinkSets TenantLinkSets `json:"link-sets,omitempty"`
}

func FindTenant

func FindTenant(key string) *Tenant

Return a pointer to tenant from collection

func (*Tenant) Delete

func (self *Tenant) Delete() error

func (*Tenant) GetKey

func (self *Tenant) GetKey() string

func (*Tenant) GetType

func (self *Tenant) GetType() string

func (*Tenant) Read

func (self *Tenant) Read() error

func (*Tenant) Write

func (self *Tenant) Write() error

type TenantCallbacks

type TenantCallbacks interface {
	TenantCreate(tenant *Tenant) error
	TenantUpdate(tenant, params *Tenant) error
	TenantDelete(tenant *Tenant) error
}

type TenantLinkSets

type TenantLinkSets struct {
	Networks map[string]modeldb.Link `json:"Networks,omitempty"`
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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