provision: github.com/digitalrebar/provision/midlayer Index | Files

package midlayer

import "github.com/digitalrebar/provision/midlayer"

midlayer contains the DHCP server code for DigitalRebar Provision. It has the responsibility for providing the actual data manipulate for the DHCP Protocol.

Index

Package Files

actions.go controller.go dhcp.go dhcpOptions.go doc.go messaging.go stack.go static.go tftp.go

func CleanUpStore Uses

func CleanUpStore(st store.Store) error

func MacStrategy Uses

func MacStrategy(p dhcp.Packet, options dhcp.Options) string

func ServeStatic Uses

func ServeStatic(listenAt string, responder http.Handler, logger *log.Logger, pubs *backend.Publishers) (*http.Server, error)

type AvailableAction Uses

type AvailableAction struct {
    models.AvailableAction
    // contains filtered or unexported fields
}

func (*AvailableAction) Release Uses

func (aa *AvailableAction) Release()

func (*AvailableAction) Reserve Uses

func (aa *AvailableAction) Reserve() error

func (*AvailableAction) Unload Uses

func (aa *AvailableAction) Unload()

type DataStack Uses

type DataStack struct {
    store.StackedStore
    // contains filtered or unexported fields
}

func DefaultDataStack Uses

func DefaultDataStack(dataRoot, backendType, localContent, defaultContent, saasDir string) (*DataStack, error)

func (*DataStack) AddReplacePlugin Uses

func (d *DataStack) AddReplacePlugin(
    name string,
    newStore store.Store,
    logger *log.Logger,
    fixup FixerUpper) (*DataStack, error, error)

func (*DataStack) AddReplaceSAAS Uses

func (d *DataStack) AddReplaceSAAS(
    name string,
    newStore store.Store,
    logger *log.Logger,
    fixup FixerUpper) (*DataStack, error, error)

func (*DataStack) Clone Uses

func (d *DataStack) Clone() *DataStack

func (*DataStack) RemovePlugin Uses

func (d *DataStack) RemovePlugin(name string, logger *log.Logger) (*DataStack, error, error)

func (*DataStack) RemoveSAAS Uses

func (d *DataStack) RemoveSAAS(name string, logger *log.Logger) (*DataStack, error, error)

type DhcpHandler Uses

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

func (*DhcpHandler) Debugf Uses

func (h *DhcpHandler) Debugf(f string, args ...interface{})

func (*DhcpHandler) Infof Uses

func (h *DhcpHandler) Infof(f string, args ...interface{})

func (*DhcpHandler) Printf Uses

func (h *DhcpHandler) Printf(f string, args ...interface{})

func (*DhcpHandler) Serve Uses

func (h *DhcpHandler) Serve() error

func (*DhcpHandler) ServeDHCP Uses

func (h *DhcpHandler) ServeDHCP(p dhcp.Packet,
    msgType dhcp.MessageType,
    options dhcp.Options,
    cm *ipv4.ControlMessage) (res dhcp.Packet)

func (*DhcpHandler) Shutdown Uses

func (h *DhcpHandler) Shutdown(ctx context.Context) error

func (*DhcpHandler) Strategy Uses

func (h *DhcpHandler) Strategy(name string) StrategyFunc

type FixerUpper Uses

type FixerUpper func(*DataStack, store.Store) error

FixerUpper takes a the datastack and a store.Store that is to be added to the passed stack. FixerUpper is responsible for making sure that it can integrate the new store into the stack, making whatever changes are needed to the current datastack to make inclusion possible. It must take care to scan and detect if it will not be able to maek changes, because any changes it has to make to items in the data stack will be live and not possible to undo after FixerUpper returns.

type MachineActions Uses

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

func NewMachineActions Uses

func NewMachineActions() *MachineActions

func (*MachineActions) Add Uses

func (ma *MachineActions) Add(model_aa *models.AvailableAction, plugin *RunningPlugin) error

func (*MachineActions) Get Uses

func (ma *MachineActions) Get(name string) (*models.AvailableAction, bool)

func (*MachineActions) List Uses

func (ma *MachineActions) List() []*models.AvailableAction

func (*MachineActions) Remove Uses

func (ma *MachineActions) Remove(aa *models.AvailableAction) error

func (*MachineActions) Run Uses

func (ma *MachineActions) Run(maa *models.MachineAction) error

type PluginClient Uses

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

func NewPluginClient Uses

func NewPluginClient(plugin string, dt *backend.DataTracker, apiPort int, path string, params map[string]interface{}) (answer *PluginClient, theErr error)

func (*PluginClient) Action Uses

func (pc *PluginClient) Action(a *models.MachineAction) error

func (*PluginClient) Config Uses

func (pc *PluginClient) Config(params map[string]interface{}) error

func (*PluginClient) Publish Uses

func (pc *PluginClient) Publish(e *models.Event) error

func (*PluginClient) ReadLog Uses

func (pc *PluginClient) ReadLog()

func (*PluginClient) ReadReply Uses

func (pc *PluginClient) ReadReply()

func (*PluginClient) Release Uses

func (pc *PluginClient) Release()

func (*PluginClient) Reserve Uses

func (pc *PluginClient) Reserve() error

func (*PluginClient) Stop Uses

func (pc *PluginClient) Stop() error

func (*PluginClient) Unload Uses

func (pc *PluginClient) Unload()

type PluginClientRequestTracker Uses

type PluginClientRequestTracker chan *models.PluginClientReply

type PluginController Uses

type PluginController struct {
    AvailableProviders map[string]*models.PluginProvider

    MachineActions *MachineActions
    // contains filtered or unexported fields
}

func InitPluginController Uses

func InitPluginController(pluginDir string, dt *backend.DataTracker, pubs *backend.Publishers, apiPort int) (pc *PluginController, err error)

func (*PluginController) GetPluginProvider Uses

func (pc *PluginController) GetPluginProvider(name string) *models.PluginProvider

func (*PluginController) GetPluginProviders Uses

func (pc *PluginController) GetPluginProviders() []*models.PluginProvider

func (*PluginController) Publish Uses

func (pc *PluginController) Publish(e *models.Event) error

func (*PluginController) Release Uses

func (pc *PluginController) Release()

func (*PluginController) RemovePlugin Uses

func (pc *PluginController) RemovePlugin(name string) error

func (*PluginController) Reserve Uses

func (pc *PluginController) Reserve() error

This never gets unloaded.

func (*PluginController) Shutdown Uses

func (pc *PluginController) Shutdown(ctx context.Context) error

func (*PluginController) Unload Uses

func (pc *PluginController) Unload()

func (*PluginController) UploadPlugin Uses

func (pc *PluginController) UploadPlugin(c *gin.Context, fileRoot, name string) (*models.PluginProviderUploadInfo, *models.Error)

type RunningPlugin Uses

type RunningPlugin struct {
    Plugin   *backend.Plugin
    Provider *models.PluginProvider
    Client   *PluginClient
}

type Service Uses

type Service interface {
    Shutdown(context.Context) error
}

func ServeTftp Uses

func ServeTftp(listen string, responder func(string, net.IP) (io.Reader, error),
    logger *log.Logger, pubs *backend.Publishers) (Service, error)

func StartDhcpHandler Uses

func StartDhcpHandler(dhcpInfo *backend.DataTracker, dhcpIfs string, dhcpPort int, pubs *backend.Publishers) (Service, error)

type Strategy Uses

type Strategy struct {
    Name     string
    GenToken StrategyFunc
}

type StrategyFunc Uses

type StrategyFunc func(p dhcp.Packet, options dhcp.Options) string

type TftpHandler Uses

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

func (*TftpHandler) Shutdown Uses

func (h *TftpHandler) Shutdown(ctx context.Context) error

Package midlayer imports 32 packages (graph) and is imported by 2 packages. Updated 2017-10-17. Refresh now. Tools for package owners.