util

package
v0.0.0-...-278bb9c Latest Latest
Warning

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

Go to latest
Published: Sep 23, 2022 License: BSD-3-Clause Imports: 7 Imported by: 0

Documentation

Overview

Package util defines various functions and types which are useful throughout the program

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func PrettyPrintStruct

func PrettyPrintStruct(a interface{})

PrettyPrintStruct prints a nice looking version of a struct

Types

type MacAddress

type MacAddress struct {
	Address string `gorm:"not null;unique;primaryKey;"`
}

MacAddress is a structure containing the unique Mac Address

func (MacAddress) GormDataType

func (mac MacAddress) GormDataType() string

GormDataType defines the datatype that a mac address is stored as

func (MacAddress) GormValue

func (mac MacAddress) GormValue(_ context.Context, _ *gorm.DB) clause.Expr

GormValue converts the mac address to an integer

func (*MacAddress) Scan

func (mac *MacAddress) Scan(v interface{}) error

Scan defines how the stored data is converted into a string

type ProgressReporter

type ProgressReporter struct {
	R   io.Reader
	Max uint
	// contains filtered or unexported fields
}

ProgressReporter is a struct which contains a reader which records the progress made Idea and basic implementation taken from: https://stackoverflow.com/questions/26050380/go-tracking-post-request-progress

func (*ProgressReporter) Read

func (pr *ProgressReporter) Read(p []byte) (int, error)

Read defines a function which keeps track of the amount of data being sent over a reader

Jump to

Keyboard shortcuts

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