bf_tx

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Sep 14, 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

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
}

type AgentMasterProperties

type AgentMasterProperties struct {
	First_Name FirstName
	Last_Name  LastName
	Sig        Sig
}

type AgentOwner

type AgentOwner struct {
	Type       string
	Properties AgentOwnerProperties
}

type AgentOwnerProperties

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

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
}

type ConditionsCarriage

type ConditionsCarriage struct {
	Type string
}

type Consignee

type Consignee struct {
	Type string //Null
}

type Date

type Date struct {
	Type   int
	Format string
}

type DescGoods

type DescGoods struct {
	Type string
}

type FirstName

type FirstName struct {
	Type string
}

type FreightAdvAmt

type FreightAdvAmt struct {
	Type int
}

type FreightPayableAmt

type FreightPayableAmt struct {
	Type int
}

type GeneralInstructions

type GeneralInstructions struct {
	Type string
}

type GrossWeight

type GrossWeight struct {
	Type int
}

type IssueDetails

type IssueDetails struct {
	Type       string
	Properties IssueDetailsProperties
}

type IssueDetailsProperties

type IssueDetailsProperties struct {
	Place_of_Issue PlaceIssue
	Date_of_Issue  Date
}

type LastName

type LastName struct {
	Type string
}

type MasterInfo

type MasterInfo struct {
	Type       string
	Properties MasterInfoProperties
}

type MasterInfoProperties

type MasterInfoProperties struct {
	First_Name FirstName
	Last_Name  LastName
	Sig        Sig
}

type NotifyAddress

type NotifyAddress struct {
	Type string
}

type NumBol

type NumBol struct {
	Type int
}

type PlaceIssue

type PlaceIssue struct {
	Type string
}

type PortDischarge

type PortDischarge struct {
	Type int
}

type PortLoading

type PortLoading struct {
	Type int
}

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
}

type RefNum

type RefNum struct {
	Type int
}

type Shipper

type Shipper struct {
	Type string
}

type Sig

type Sig struct {
	Type string
}

type Vessel

type Vessel struct {
	Type int
}

Jump to

Keyboard shortcuts

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