You are an expert in writing code in many different languages. Your goal is to perform code completion for the following code, keeping in mind the rest of the code and the file meta data.
    Metadata details:
    filename: destroy.go
    path of file: ./repos/nanobox/processors/component
    
    the code of the file until where you have to start completion: package component

import (
	"net"

	"github.com/jcelliott/lumber"
	"github.com/nanobox-io/golang-docker-client"

	"github.com/nanobox-io/nanobox/models"
	"github.com/nanobox-io/nanobox/util"
	"github.com/nanobox-io/nanobox/util/dhcp"
	"github.com/nanobox-io/nanobox/util/display"
)

// Destroy destroys a component from the provider and database
func Destroy(appMode
    
func Destroy(appModel *models.App, componentModel *models.Component) error {
	display.OpenContext(componentModel.Label)
	defer display.CloseContext()

	// remove the docker container
	if err := destroyContainer(componentModel.ID); err != nil {
		// report the error but continue on
		lumber.Error("component:Destroy:destroyContainer(%s): %s", componentModel.ID, err)
		// return err
	}

	// detach from the host network
	if err := detachNetwork(appModel, componentModel); err != nil {
		return util.ErrorAppend(err, "failed to detach container from the host network")
	}

	// purge evars
	if err := componentModel.PurgeEvars(appModel); err != nil {
		lumber.Error("component:Destroy:models.Component.PurgeEvars(%+v): %s", appModel, err.Error())
		return util.ErrorAppend(err, "failed to purge component evars from app")
	}

	// destroy the data model
	if err := componentModel.Delete(); err != nil {
		lumber.Error("component:Destroy:models.Component.Delete()")
		return util.ErrorAppend(err, "failed to destroy component model")
	}

	return nil
}