bf_tx

package
v0.5.15 Latest Latest
Warning

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

Go to latest
Published: Feb 19, 2018 License: MIT Imports: 6 Imported by: 16

Documentation

Overview

Package bf_tx is a package that defines the Blockfreight™ Transaction (BF_TX) transaction standard and provides some useful functions to work with the BF_TX.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BFTXContent added in v0.5.0

func BFTXContent(bftx BF_TX) (string, error)

BFTXContent receives the BF_TX structure, applies it the json.Marshal procedure and return the content of the BF_TX JSON.

func GenerateBFTXUID added in v0.5.0

func GenerateBFTXUID(hash []byte, salt []byte) string

GenerateBFTXUID hashes two byte arrays and returns it.

func HashBFTX added in v0.5.0

func HashBFTX(bftx BF_TX) ([]byte, error)

HashBFTX hashes the BF_TX object

func PrintBFTX added in v0.5.0

func PrintBFTX(bftx BF_TX)

PrintBFTX receives a BF_TX and prints it clearly.

func State

func State(bftx BF_TX) string

State reports the current state of a BF_TX

Types

type AgentMaster

type AgentMaster struct {
	FirstName string `json:"FirstName"`
	LastName  string `json:"LastName"`
	Sig       string `json:"Sig"`
}

AgentMaster struct

type AgentOwner

type AgentOwner struct {
	FirstName             string `json:"FirstName"`
	LastName              string `json:"LastName"`
	Sig                   string `json:"Sig"`
	ConditionsForCarriage string `json:"ConditionsForCarriage"`
}

AgentOwner struct

type BF_TX

type BF_TX struct {
	// =========================
	// Bill of Lading attributes
	// =========================
	Properties Properties

	// ===================================
	// Blockfreight Transaction attributes
	// ===================================
	Id          string           `json:"Id"`
	PrivateKey  ecdsa.PrivateKey `json:"-"`
	Signhash    []uint8          `json:"Signhash"`
	Signature   string           `json:"Signature"`
	Verified    bool             `json:"Verified"`
	Transmitted bool             `json:"Transmitted"`
	Amendment   string           `json:"Amendment"`
	Private     string           `json:"Private"`
}

BF_TX structure respresents an logical abstraction of a Blockfreight™ Transaction.

func ByteArrayToBFTX added in v0.5.0

func ByteArrayToBFTX(obj []byte) BF_TX

func Reinitialize

func Reinitialize(bftx BF_TX) BF_TX

Reinitialize set the default values to the Blockfreight attributes of BF_TX

func SetBFTX added in v0.5.0

func SetBFTX(jsonpath string) (BF_TX, error)

SetBFTX receives the path of a JSON, reads it and returns the BF_TX structure with all attributes.

type BolNum

type BolNum struct {
	Type string
}

BolNum struct

type ConditionsCarriage

type ConditionsCarriage struct {
	Type string
}

ConditionsCarriage struct

type Consignee

type Consignee struct {
	Type string //Null
}

Consignee struct

type Date

type Date struct {
	Type   string
	Format string
}

Date struct

type DescGoods

type DescGoods struct {
	Type string
}

DescGoods struct

type FirstName

type FirstName struct {
	Type string
}

FirstName struct

type FreightAdvAmt

type FreightAdvAmt struct {
	Type string
}

FreightAdvAmt struct

type FreightPayableAmt

type FreightPayableAmt struct {
	Type string
}

FreightPayableAmt struct

type GeneralInstructions

type GeneralInstructions struct {
	Type string
}

GeneralInstructions struct

type GrossWeight

type GrossWeight struct {
	Type string
}

GrossWeight struct

type IssueDetails

type IssueDetails struct {
	PlaceOfIssue string `json:"PlaceOfIssue"`
	DateOfIssue  string `json:"DateOfIssue"`
}

IssueDetails struct

type LastName

type LastName struct {
	Type string
}

LastName struct

type MasterInfo

type MasterInfo struct {
	FirstName string `json:"FirstName"`
	LastName  string `json:"LastName"`
	Sig       string `json:"Sig"`
}

MasterInfo struct

type NotifyAddress

type NotifyAddress struct {
	Type string
}

NotifyAddress struct

type NumBol

type NumBol struct {
	Type string
}

NumBol struct

type PlaceIssue

type PlaceIssue struct {
	Type string
}

PlaceIssue struct

type PortDischarge

type PortDischarge struct {
	Type string
}

PortDischarge struct

type PortLoading

type PortLoading struct {
	Type string
}

PortLoading struct

type Properties

type Properties struct {
	Shipper             string       `protobuf:"bytes,1,opt,name=Shipper" json:"Shipper"`
	BolNum              string       `protobuf:"varint,1,opt,name=BolNum" json:"BolNum"`
	RefNum              string       `protobuf:"varint,2,opt,name=RefNum" json:"RefNum"`
	Consignee           string       `protobuf:"bytes,2,opt,name=Consignee" json:"Consignee"`
	HouseBill           string       `protobuf:"bytes,3,opt,name=HouseBill" json:"HouseBill"`
	Vessel              string       `protobuf:"varint,3,opt,name=Vessel" json:"Vessel"`
	Packages            string       `protobuf:"varint,4,opt,name=Packages" json:"Packages"`
	PackType            string       `protobuf:"bytes,4,opt,name=PackType" json:"PackType"`
	INCOTerms           string       `protobuf:"bytes,5,opt,name=INCOTerms" json:"INCOTerms"`
	PortOfLoading       string       `protobuf:"bytes,6,opt,name=PortOfLoading" json:"PortOfLoading"`
	PortOfDischarge     string       `protobuf:"bytes,7,opt,name=PortOfDischarge" json:"PortOfDischarge"`
	Destination         string       `protobuf:"bytes,8,opt,name=Destination" json:"Destination"`
	MarksAndNumbers     string       `protobuf:"bytes,9,opt,name=MarksAndNumbers" json:"MarksAndNumbers"`
	UnitOfWeight        string       `protobuf:"bytes,10,opt,name=UnitOfWeight" json:"UnitOfWeight"`
	DeliverAgent        string       `protobuf:"bytes,11,opt,name=DeliverAgent" json:"DeliverAgent"`
	ReceiveAgent        string       `protobuf:"bytes,12,opt,name=ReceiveAgent" json:"ReceiveAgent"`
	Container           string       `protobuf:"bytes,13,opt,name=Container" json:"Container"`
	ContainerSeal       string       `protobuf:"bytes,14,opt,name=ContainerSeal" json:"ContainerSeal"`
	ContainerMode       string       `protobuf:"bytes,15,opt,name=ContainerMode" json:"ContainerMode"`
	ContainerType       string       `protobuf:"bytes,16,opt,name=ContainerType" json:"ContainerType"`
	Volume              string       `protobuf:"bytes,17,opt,name=Volume" json:"Volume"`
	UnitOfVolume        string       `protobuf:"bytes,18,opt,name=UnitOfVolume" json:"UnitOfVolume"`
	NotifyAddress       string       `protobuf:"bytes,19,opt,name=NotifyAddress" json:"NotifyAddress"`
	DescOfGoods         string       `protobuf:"bytes,20,opt,name=DescOfGoods" json:"DescOfGoods"`
	GrossWeight         string       `protobuf:"varint,5,opt,name=GrossWeight" json:"GrossWeight"`
	FreightPayableAmt   string       `protobuf:"varint,6,opt,name=FreightPayableAmt" json:"FreightPayableAmt"`
	FreightAdvAmt       string       `protobuf:"varint,7,opt,name=FreightAdvAmt" json:"FreightAdvAmt"`
	GeneralInstructions string       `protobuf:"bytes,21,opt,name=GeneralInstructions" json:"GeneralInstructions"`
	DateShipped         string       `protobuf:"bytes,22,opt,name=DateShipped" json:"DateShipped"`
	IssueDetails        IssueDetails `json:"IssueDetails"`
	NumBol              string       `protobuf:"varint,8,opt,name=NumBol" json:"NumBol"`
	MasterInfo          MasterInfo   `json:"MasterInfo"`
	AgentForMaster      AgentMaster  `json:"AgentForMaster"`
	AgentForOwner       AgentOwner   `json:"AgentForOwner"`
	EncryptionMetaData  string       `json:"EncryptionMetaData"`
}

Properties struct

type RefNum

type RefNum struct {
	Type string
}

RefNum struct

type Shipper

type Shipper struct {
	Type string
}

Shipper struct

type Sig

type Sig struct {
	Type string
}

Sig struct

type Vessel

type Vessel struct {
	Type string
}

Vessel struct

Jump to

Keyboard shortcuts

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