utils

package
v0.0.5 Latest Latest
Warning

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

Go to latest
Published: Aug 10, 2022 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CopySlice

func CopySlice[A any](s []A) []A

func DoOrDie

func DoOrDie(err error)

func GetFileFromURL

func GetFileFromURL(url string, path string) error

func GetURL

func GetURL(url string) ([]byte, error)

func JsonDiffHelper

func JsonDiffHelper(a interface{}, b interface{}, pathContext []string, diffs *JsonDocumentDiffs)

func Pointer

func Pointer(s string) *string

func SetUpLogger

func SetUpLogger(logLevelStr string) error

func StringPrefix

func StringPrefix(s string, chars int) string

Types

type DiffType

type DiffType string
const (
	DiffTypeAdd    DiffType = "DiffTypeAdd"
	DiffTypeRemove DiffType = "DiffTypeRemove"
	DiffTypeChange DiffType = "DiffTypeChange"
	DiffTypeSame   DiffType = "DiffTypeSame"
)

func (DiffType) Short

func (d DiffType) Short() string

type JDiff

type JDiff struct {
	Type DiffType
	Path []string
	Old  interface{}
	New  interface{}
}

type JsonDocumentDiffs

type JsonDocumentDiffs struct {
	Elements []*JDiff
}

func DiffJsonValues

func DiffJsonValues(a interface{}, b interface{}) *JsonDocumentDiffs

func (*JsonDocumentDiffs) Add

func (d *JsonDocumentDiffs) Add(e *JDiff)

Jump to

Keyboard shortcuts

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