utils

package
v0.1.7 Latest Latest
Warning

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

Go to latest
Published: Feb 26, 2024 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetOsAndSemver

func GetOsAndSemver(id string) (string, *semver.Version, error)

COPIED FROM METAL-API

GetOsAndSemver parses a imageID to OS and Semver, or returns an error the last part must be the semantic version, valid ids are: ubuntu-19.04 os: ubuntu version: 19.04 ubuntu-19.04.20200408 os: ubuntu version: 19.04.20200408 ubuntu-small-19.04.20200408 os: ubuntu-small version: 19.04.20200408

Types

type CronLogger

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

func NewCronLogger

func NewCronLogger(logger *slog.Logger) *CronLogger

func (*CronLogger) Error

func (c *CronLogger) Error(err error, msg string, keysAndValues ...interface{})

func (*CronLogger) Info

func (c *CronLogger) Info(msg string, keysAndValues ...interface{})

type HTTPRedirectResponseWriter added in v0.1.2

type HTTPRedirectResponseWriter struct {
	http.ResponseWriter
	// contains filtered or unexported fields
}

HTTPRedirectResponseWriter redirects to the HTTPS address of the requested resource on 404.

func NewHTTPRedirectResponseWriter added in v0.1.2

func NewHTTPRedirectResponseWriter(wrap http.ResponseWriter, req *http.Request) *HTTPRedirectResponseWriter

func (*HTTPRedirectResponseWriter) GetStatus added in v0.1.2

func (h *HTTPRedirectResponseWriter) GetStatus() int

func (*HTTPRedirectResponseWriter) Write added in v0.1.2

func (h *HTTPRedirectResponseWriter) Write(data []byte) (int, error)

func (*HTTPRedirectResponseWriter) WriteHeader added in v0.1.2

func (h *HTTPRedirectResponseWriter) WriteHeader(code int)

Jump to

Keyboard shortcuts

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