provision

package
v0.0.11 Latest Latest
Warning

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

Go to latest
Published: Feb 27, 2024 License: GPL-3.0 Imports: 31 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ContextKeyToken     = "token"
	ContextKeyBootImage = "bootimage"
	ContextKeyHost      = "host"
	ContextKeyNIC       = "nic"
)
View Source
const (
	DefaultPort = 80
)

Variables

This section is empty.

Functions

func Add added in v0.0.8

func Add(a, b int) int

func ConfigValueBool added in v0.0.8

func ConfigValueBool(key string) bool

func ConfigValueString added in v0.0.8

func ConfigValueString(key string) string

func ConfigValueStringSlice added in v0.0.8

func ConfigValueStringSlice(key string) []string

func Contains added in v0.0.8

func Contains(s, substr string) bool

func CryptSHA256 added in v0.0.9

func CryptSHA256(pass, salt string) string

func CryptSHA512 added in v0.0.9

func CryptSHA512(pass, salt string) string

func Debug

func Debug(i ...interface{})

Debug output message of debug level

func Debugf

func Debugf(format string, args ...interface{})

Debugf output format message of debug level

func Debugj

func Debugj(j echolog.JSON)

Debugj output json of debug level

func DellSHA256Password added in v0.0.9

func DellSHA256Password(pass, salt string) string

func Error

func Error(i ...interface{})

Error output message of error level

func Errorf

func Errorf(format string, args ...interface{})

Errorf output format message of error level

func Errorj

func Errorj(j echolog.JSON)

Errorj output json of error level

func Fatal

func Fatal(i ...interface{})

Fatal output message of fatal level

func Fatalf

func Fatalf(format string, args ...interface{})

Fatalf output format message of fatal level

func Fatalj

func Fatalj(j echolog.JSON)

Fatalj output json of fatal level

func HTTPErrorHandler

func HTTPErrorHandler(err error, c echo.Context)

func Info

func Info(i ...interface{})

Info output message of info level

func Infof

func Infof(format string, args ...interface{})

Infof output format message of info level

func Infoj

func Infoj(j echolog.JSON)

Infoj output json of info level

func Join added in v0.0.8

func Join(s []string, sep string) string

func Mul added in v0.0.11

func Mul(a, b int) int

func Panic

func Panic(i ...interface{})

Panic output message of panic level

func Panicf

func Panicf(format string, args ...interface{})

Panicf output format message of panic level

func Panicj

func Panicj(j echolog.JSON)

Panicj output json of panic level

func Print

func Print(i ...interface{})

Print output message of print level

func Printf

func Printf(format string, i ...interface{})

Printf output format message of print level

func Printj

func Printj(j echolog.JSON)

Printj output json of print level

func Split added in v0.0.8

func Split(s, sep string) []string

func TokenRequired added in v0.0.2

func TokenRequired(next echo.HandlerFunc) echo.HandlerFunc

func Warn

func Warn(i ...interface{})

Warn output message of warn level

func Warnf

func Warnf(format string, args ...interface{})

Warnf output format message of warn level

func Warnj

func Warnj(j echolog.JSON)

Warnj output json of warn level

Types

type Handler

type Handler struct {
	DB               model.DataStore
	DefaultImageName string
}

func NewHandler

func NewHandler(db model.DataStore, defaultImageName string) (*Handler, error)

func (*Handler) BmcTemplate added in v0.0.9

func (h *Handler) BmcTemplate(c echo.Context) error

func (*Handler) Complete added in v0.0.8

func (h *Handler) Complete(c echo.Context) error

func (*Handler) File

func (h *Handler) File(c echo.Context) error

func (*Handler) Ignition added in v0.0.7

func (h *Handler) Ignition(c echo.Context) error

func (*Handler) Index

func (h *Handler) Index(c echo.Context) error

func (*Handler) Ipxe

func (h *Handler) Ipxe(c echo.Context) error

func (*Handler) Kickstart

func (h *Handler) Kickstart(c echo.Context) error

func (*Handler) LoadBootImageWithDefault

func (h *Handler) LoadBootImageWithDefault(name string) (*model.BootImage, error)

func (*Handler) MetaData added in v0.0.6

func (h *Handler) MetaData(c echo.Context) error

func (*Handler) Onie added in v0.0.9

func (h *Handler) Onie(c echo.Context) error

func (*Handler) ProvisionTemplate added in v0.0.8

func (h *Handler) ProvisionTemplate(c echo.Context) error

func (*Handler) ServiceDiscovery added in v0.0.11

func (h *Handler) ServiceDiscovery(c echo.Context) error

func (*Handler) SetupRoutes

func (h *Handler) SetupRoutes(e *echo.Echo)

func (*Handler) UserData added in v0.0.6

func (h *Handler) UserData(c echo.Context) error

func (*Handler) VendorData added in v0.0.6

func (h *Handler) VendorData(c echo.Context) error

type MyLogger

type MyLogger struct {
	*logrus.Entry
}

MyLogger extend logrus.MyLogger

func EchoLogger

func EchoLogger() *MyLogger

Logger return singleton logger

func (*MyLogger) Debug

func (l *MyLogger) Debug(i ...interface{})

Debug output message of debug level

func (*MyLogger) Debugf

func (l *MyLogger) Debugf(format string, args ...interface{})

Debugf output format message of debug level

func (*MyLogger) Debugj

func (l *MyLogger) Debugj(j echolog.JSON)

Debugj output message of debug level

func (*MyLogger) Error

func (l *MyLogger) Error(i ...interface{})

Error output message of error level

func (*MyLogger) Errorf

func (l *MyLogger) Errorf(format string, args ...interface{})

Errorf output format message of error level

func (*MyLogger) Errorj

func (l *MyLogger) Errorj(j echolog.JSON)

Errorj output json of error level

func (*MyLogger) Fatal

func (l *MyLogger) Fatal(i ...interface{})

Fatal output message of fatal level

func (*MyLogger) Fatalf

func (l *MyLogger) Fatalf(format string, args ...interface{})

Fatalf output format message of fatal level

func (*MyLogger) Fatalj

func (l *MyLogger) Fatalj(j echolog.JSON)

Fatalj output json of fatal level

func (*MyLogger) Formatter

func (l *MyLogger) Formatter() logrus.Formatter

Formatter return logger formatter

func (*MyLogger) Info

func (l *MyLogger) Info(i ...interface{})

Info output message of info level

func (*MyLogger) Infof

func (l *MyLogger) Infof(format string, args ...interface{})

Infof output format message of info level

func (*MyLogger) Infoj

func (l *MyLogger) Infoj(j echolog.JSON)

Infoj output json of info level

func (*MyLogger) Level

func (l *MyLogger) Level() echolog.Lvl

Level return logger level

func (*MyLogger) Output

func (l *MyLogger) Output() io.Writer

Output return logger io.Writer

func (*MyLogger) Panic

func (l *MyLogger) Panic(i ...interface{})

Panic output message of panic level

func (*MyLogger) Panicf

func (l *MyLogger) Panicf(format string, args ...interface{})

Panicf output format message of panic level

func (*MyLogger) Panicj

func (l *MyLogger) Panicj(j echolog.JSON)

Panicj output json of panic level

func (*MyLogger) Prefix

func (l *MyLogger) Prefix() string

Prefix return logger prefix This function do nothing

func (*MyLogger) Print

func (l *MyLogger) Print(i ...interface{})

Print output message of print level

func (*MyLogger) Printf

func (l *MyLogger) Printf(format string, args ...interface{})

Printf output format message of print level

func (*MyLogger) Printj

func (l *MyLogger) Printj(j echolog.JSON)

Printj output json of print level

func (*MyLogger) SetFormatter

func (l *MyLogger) SetFormatter(formatter logrus.Formatter)

SetFormatter logger formatter Only support logrus formatter

func (*MyLogger) SetHeader

func (l *MyLogger) SetHeader(h string)

SetHeader logger header Managed by Logrus itself This function do nothing

func (*MyLogger) SetLevel

func (l *MyLogger) SetLevel(v echolog.Lvl)

SetLevel logger level

func (*MyLogger) SetOutput

func (l *MyLogger) SetOutput(w io.Writer)

SetOutput logger io.Writer

func (*MyLogger) SetPrefix

func (l *MyLogger) SetPrefix(p string)

SetPrefix logger prefix This function do nothing

func (*MyLogger) Warn

func (l *MyLogger) Warn(i ...interface{})

Warn output message of warn level

func (*MyLogger) Warnf

func (l *MyLogger) Warnf(format string, args ...interface{})

Warnf output format message of warn level

func (*MyLogger) Warnj

func (l *MyLogger) Warnj(j echolog.JSON)

Warnj output json of warn level

type Onie added in v0.0.9

type Onie struct {
	SerialNumber string
	MAC          net.HardwareAddr
	VendorID     uint32
	Machine      string
	MachineRev   uint32
	Arch         string
	SecurityKey  string
	Operation    OnieOp
}

func NewOnieFromHeaders added in v0.0.9

func NewOnieFromHeaders(header http.Header) (*Onie, error)

func (Onie) UpdaterFilePath added in v0.0.9

func (o Onie) UpdaterFilePath() string

type OnieOp added in v0.0.9

type OnieOp int
const (
	OnieInstall OnieOp = iota
	OnieUpdate
)

func (OnieOp) String added in v0.0.9

func (op OnieOp) String() string

type Server

type Server struct {
	ListenAddress net.IP
	ServerAddress net.IP
	Port          int
	Scheme        string
	KeyFile       string
	CertFile      string
	RepoDir       string
	DB            model.DataStore
	// contains filtered or unexported fields
}

func NewServer

func NewServer(db model.DataStore, address string) (*Server, error)

func (*Server) Serve

func (s *Server) Serve(defaultImageName string) error

func (*Server) Shutdown

func (s *Server) Shutdown(ctx context.Context) error

type TemplateRenderer

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

func NewTemplateRenderer

func NewTemplateRenderer() (*TemplateRenderer, error)

func (*TemplateRenderer) Render

func (t *TemplateRenderer) Render(w io.Writer, name string, data interface{}, c echo.Context) error

func (*TemplateRenderer) RenderIgnition added in v0.0.7

func (t *TemplateRenderer) RenderIgnition(code int, name string, data interface{}, c echo.Context) error

Jump to

Keyboard shortcuts

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