Acb1

package
v0.7.10 Latest Latest
Warning

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

Go to latest
Published: Mar 26, 2024 License: MIT Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DoGet

func DoGet(uri string, args ...string) (status int, rv string)

Modified to send Header!

--------------------------------------------- // Xyzzy101 - Setup QR Redirect ---------------------------------------------

export QR_SHORT_AUTH_TOKEN="w4h0wvtb1zk4uf8Xv.Ns9Q7j8"
wget -o out/,list1 -O out/,list2 \
	--header "X-Qr-Auth: ${QR_SHORT_AUTH_TOKEN}" \
	"http://t432z.com/upd/?url=http://test.test.com&id=5c"

-- 1. DoGet - change to create a header
-- 2. Example Call to set this

func FindTagId

func FindTagId(hdlr *Acb1Type, premis_id, premis_animal string) (string, error)

func KeeackHash

func KeeackHash(b []byte) []byte

func SerializeAnimal

func SerializeAnimal(dt DataSetHashed) []byte

func SerializeDataToBeHashed

func SerializeDataToBeHashed(dt DataToBeHashed) []byte

Types

type Acb1Type

type Acb1Type struct {
	Next        http.Handler //
	Paths       []string     //
	AuthKey     string       // (acb)
	RedisPrefix string       //
	InputPath   string       //
	OutputPath  string       //
	OutputURL   string       //
	DisplayURL  string       // URL to display results - destination of QR redirect

	LineNo int //
	// contains filtered or unexported fields
}

func NewAcb1TypeServer

func NewAcb1TypeServer(n http.Handler, p []string, redisPrefix, realm string) *Acb1Type

NewAcb1TypeServer will create a copy of the server for testing.

func (*Acb1Type) GetAllRows

func (hdlr *Acb1Type) GetAllRows(tag string) (rowData string, err error)

data, err := hdlr.GetAllRows(tag)

func (*Acb1Type) GetCowDisplayData

func (hdlr *Acb1Type) GetCowDisplayData(tag string) (dataJsonString string, err error)

func (*Acb1Type) GetMostRecentHash

func (hdlr *Acb1Type) GetMostRecentHash(tag string) (hash, ord_seq, qr_enc_id string, err error)

func (*Acb1Type) InitializeWithConfigData

func (hdlr *Acb1Type) InitializeWithConfigData(next http.Handler, gCfg *cfg.ServerGlobalConfigType, serverName string, pNo, callNo int) (err error)

func (*Acb1Type) InsertTrackAdd

func (hdlr *Acb1Type) InsertTrackAdd(tag, note string) (string, error)

func (*Acb1Type) PreValidate

func (hdlr *Acb1Type) PreValidate(gCfg *cfg.ServerGlobalConfigType, cfgData map[string]interface{}, serverName string, pNo, callNo int) (err error)

func (*Acb1Type) PullQRFromDB

func (hdlr *Acb1Type) PullQRFromDB(tag string) (qr_enc_id string, err error)

err = hdlr.PullQRFromDB(rr.Tag)

func (*Acb1Type) ServeHTTP

func (hdlr *Acb1Type) ServeHTTP(www http.ResponseWriter, req *http.Request)

func (*Acb1Type) SetupServer

func (hdlr *Acb1Type) SetupServer()

func (*Acb1Type) SetupValidEvents

func (hdlr *Acb1Type) SetupValidEvents()

func (*Acb1Type) UpdateAnimalWithQR

func (hdlr *Acb1Type) UpdateAnimalWithQR(tag, qrId string) error

func (*Acb1Type) UpdateHashCurrentRow

func (hdlr *Acb1Type) UpdateHashCurrentRow(tag, max_ord_seq, newHash string) (err error)

hdlr.UpdateHashCurrentRow(tag, max_ord_seq, newHash)

func (*Acb1Type) UpdateQRMarkAsUsed

func (hdlr *Acb1Type) UpdateQRMarkAsUsed(qrId string) error

type DataDisplayType

type DataDisplayType struct {
	Cow            string
	Ranch          string
	SlaughterHouse string
	Aged           string
	DryAged        string
}

-------------------------------------------------------------- cowData := GetCowDisplayData(rr.Tag) // xyzzy --------------------------------------------------------------

{
	"Cow": "rfid: 111"

, "Ranch": "Ranch: RC" , "SlaughterHouse": "Wyoming Beef Lab" , "Aged": "Aged: 14 days" , "DryAged": "" }

type DataSetHashed

type DataSetHashed []DataToBeHashed

type DataToBeHashed

type DataToBeHashed struct {
	Tag      string
	PrevHash string `json:"prev_hash"`
	Created  string
	Note     string
}

Jump to

Keyboard shortcuts

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