bf_tx

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Oct 3, 2017 License: MIT Imports: 6 Imported by: 0

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 BF_TXContent

func BF_TXContent(bf_tx BF_TX) (string, error)

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

func HashBF_TX

func HashBF_TX(bf_tx BF_TX) ([]byte, error)

HashBF_TX hashes the BF_TX object

func HashBF_TX_salt

func HashBF_TX_salt(hash []byte, salt []byte) []byte

HashBF_TX_salt hashes two byte arrays and returns it.

func PrintBF_TX

func PrintBF_TX(bf_tx BF_TX)

PrintBF_TX receives a BF_TX and prints it clearly.

func State

func State(bf_tx BF_TX) string

State reports the current state of a BF_TX

Types

type AgentMaster

type AgentMaster struct {
	Type       string
	Properties AgentMasterProperties
}

AgentMaster struct

type AgentMasterProperties

type AgentMasterProperties struct {
	First_Name FirstName
	Last_Name  LastName
	Sig        Sig
}

AgentMasterProperties struct

type AgentOwner

type AgentOwner struct {
	Type       string
	Properties AgentOwnerProperties
}

AgentOwner struct

type AgentOwnerProperties

type AgentOwnerProperties struct {
	First_Name              FirstName
	Last_Name               LastName
	Sig                     Sig
	Conditions_for_Carriage ConditionsCarriage
}

AgentOwnerProperties struct

type BF_TX

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

	// ===================================
	// Blockfreight Transaction attributes
	// ===================================
	Id          string
	PrivateKey  ecdsa.PrivateKey
	Signhash    []uint8
	Signature   string
	Verified    bool
	Transmitted bool
	Amendment   string
}

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

func Reinitialize

func Reinitialize(bf_tx BF_TX) BF_TX

Reinitialize set the default values to the Blockfreight attributes of BF_TX

func SetBF_TX

func SetBF_TX(jsonpath string) (BF_TX, error)

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

type BolNum

type BolNum struct {
	Type int
}

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   int
	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 int
}

FreightAdvAmt struct

type FreightPayableAmt

type FreightPayableAmt struct {
	Type int
}

FreightPayableAmt struct

type GeneralInstructions

type GeneralInstructions struct {
	Type string
}

GeneralInstructions struct

type GrossWeight

type GrossWeight struct {
	Type int
}

GrossWeight struct

type IssueDetails

type IssueDetails struct {
	Type       string
	Properties IssueDetailsProperties
}

IssueDetails struct

type IssueDetailsProperties

type IssueDetailsProperties struct {
	Place_of_Issue PlaceIssue
	Date_of_Issue  Date
}

IssueDetailsProperties struct

type LastName

type LastName struct {
	Type string
}

LastName struct

type MasterInfo

type MasterInfo struct {
	Type       string
	Properties MasterInfoProperties
}

Masterinfo struct

type MasterInfoProperties

type MasterInfoProperties struct {
	First_Name FirstName
	Last_Name  LastName
	Sig        Sig
}

MasterInfoProperties struct

type NotifyAddress

type NotifyAddress struct {
	Type string
}

NotifyAddress struct

type NumBol

type NumBol struct {
	Type int
}

Numbol struct

type PlaceIssue

type PlaceIssue struct {
	Type string
}

PlaceIssue struct

type PortDischarge

type PortDischarge struct {
	Type int
}

PortDischarge struct

type PortLoading

type PortLoading struct {
	Type int
}

PortLoading struct

type Properties

type Properties struct {
	Shipper              Shipper
	Bol_Num              BolNum
	Ref_Num              RefNum
	Consignee            Consignee
	Vessel               Vessel
	Port_of_Loading      PortLoading
	Port_of_Discharge    PortDischarge
	Notify_Address       NotifyAddress
	Desc_of_Goods        DescGoods
	Gross_Weight         GrossWeight
	Freight_Payable_Amt  FreightPayableAmt
	Freight_Adv_Amt      FreightAdvAmt
	General_Instructions GeneralInstructions
	Date_Shipped         Date
	Issue_Details        IssueDetails
	Num_Bol              NumBol
	Master_Info          MasterInfo
	Agent_for_Master     AgentMaster
	Agent_for_Owner      AgentOwner
}

Properties struct

type RefNum

type RefNum struct {
	Type int
}

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 int
}

Vessel struct

Jump to

Keyboard shortcuts

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