util

package
v0.1.2 Latest Latest
Warning

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

Go to latest
Published: Apr 1, 2021 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetEnvOrDefault

func GetEnvOrDefault(key string, defaultValue string) string

Get an environment variable or return the default value

func InArray

func InArray(val interface{}, array interface{}) (exists bool, index int)

Check if a given value exists in the given array

func Inertia

func Inertia(v interface{}) template.HTML

func JsonEncode

func JsonEncode(v interface{}) template.JS

func JsonEncodeRaw

func JsonEncodeRaw(v interface{}) string

func MergeMaps

func MergeMaps(a map[string]interface{}, b map[string]interface{}) map[string]interface{}

Merge two maps, overriding existing keys from b --> a into a new map

func Mix

func Mix(path string, manifestPath ...string) template.HTML

func WalkRecursive

func WalkRecursive(values map[string]interface{}, fn func(interface{}))

Iterate over a given map recursively and call the given func on every value

Types

type Ziggy

type Ziggy struct {
	BaseDomain   string                `json:"baseDomain"`
	BasePort     int                   `json:"basePort"`
	BaseProtocol string                `json:"baseProtocol"`
	BaseUrl      string                `json:"baseUrl"`
	Group        string                `json:"group"`
	Routes       map[string]ZiggyRoute `json:"namedRoutes"`
}

https://github.com/tightenco/ziggy base struct to export compatible Echo routes

func NewZiggy

func NewZiggy(echo *echo.Echo, page map[string]interface{}) Ziggy

type ZiggyRoute

type ZiggyRoute struct {
	Uri     string   `json:"uri"`
	Methods []string `json:"methods"`
	Domain  string   `json:"domain"`
}

A single https://github.com/tightenco/ziggy route

Jump to

Keyboard shortcuts

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