src

package
v0.0.0-...-e479a39 Latest Latest
Warning

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

Go to latest
Published: Jan 12, 2023 License: MIT Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Funcmap = template.FuncMap{
	"parseDate": ParseDate,
	"json":      ToJson,
}
View Source
var Logger *zap.Logger = nil

Functions

func Generate

func Generate(b *rod.Browser, c GenerateConfig) ([]byte, error)

func InitLogging

func InitLogging(mode string)

func ParseDate

func ParseDate(d time.Time) string

func Router

func Router(e *echo.Echo)

func Server

func Server()

func ToJson

func ToJson(d any) string

Types

type CommonData

type CommonData struct {
	Date  time.Time `json:"date"`
	Title string    `json:"title"`
}

type EarthquakeInfoForm

type EarthquakeInfoForm struct {
	Epicenter PositionData `json:"epicenter,omitempty"`
	Ints      struct {
		Int1  []PositionData `json:"int1,omitempty"`
		Int2  []PositionData `json:"int2,omitempty"`
		Int3  []PositionData `json:"int3,omitempty"`
		Int4  []PositionData `json:"int4,omitempty"`
		Int5l []PositionData `json:"int5l,omitempty"`
		Int5u []PositionData `json:"int5u,omitempty"`
		Int6l []PositionData `json:"int6l,omitempty"`
		Int6u []PositionData `json:"int6u,omitempty"`
		Int7  []PositionData `json:"int7,omitempty"`
	} `json:"ints"`
	CommonData
}

type GenerateConfig

type GenerateConfig struct {
	URL    url.URL
	Width  int
	Height int
	Scale  float64
}

type Handler

type Handler struct {
}

func NewHandler

func NewHandler() *Handler

func (*Handler) EarthquakeInfoHandler

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

func (*Handler) RootHandler

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

type PositionData

type PositionData struct {
	Lat float64 `json:"lat"`
	Lon float64 `json:"lon"`
}

type Template

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

func (*Template) Render

func (t *Template) Render(w io.Writer, name string, data any, c echo.Context) error

Jump to

Keyboard shortcuts

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