func Instances() []*Instance {
	return instances
}
Instances returns the list of instances.
package casket
import (
	"bytes"
	"encoding/gob"
	"fmt"
	"io"
	"io/ioutil"
	"log"
	"net"
	"os"
	"strconv"
	"strings"
	"sync"
	"time"
	"github.com/tmpim/casket/casketfile"
	"github.com/tmpim/casket/telemetry"
)
var (
	AppName string
	AppVersion string
	Quiet bool
	PidFile string
	GracefulTimeout time.Duration
	isUpgrade = os.Getenv("CASKET__UPGRADE") == "1"
	started bool
	mu sync.Mutex
)
func init() {
	OnProcessExit = append(OnProcessExit, func() {
		if PidFile != "" {
			os.Remove(PidFile)
		}
	})
}
type Instance struct {
	serverType string
	casketfileInput Input
	wg *sync.WaitGroup
	context Context
	servers []ServerListener
	OnFirstStartup  []func() error  
	OnStartup       []func() error  
	OnRestart       []func() error  
	OnRestartFailed []func() error  
	OnShutdown      []func() error  
	OnFinalShutdown []func() error  
	Storage   map[interface{}]interface{}
	StorageMu sync.RWMutex
}