Documentation ¶
Index ¶
- func CopyFile(src, dst string) (err error)
- func Exists(name string) bool
- func GetFilenames(dir string) (filenames, dirs []string)
- func HashFile(fn string) []byte
- func HashImages(imageList []imageTypeList) []byte
- func HashStrngOf(data string) (h []byte)
- func HashStrngOfReturnHex(data string) (s string)
- func InsertImage(pdf *gofpdf.Fpdf, fn string, pos int) *gofpdf.Fpdf
- func Keccak256(data ...[]byte) []byte
- func MatchFn(need imageTypeList, fns []string) bool
- func MerkleHash(data [][]byte) []byte
- func MerkleLeaves(hLeaf [][]byte) []byte
- func MoveFile(from, to string) (err error)
- func NewReport() *gofpdf.Fpdf
- func SavePDF(pdf *gofpdf.Fpdf, fn string) error
- func SearializeDocumentType(dt documentType) []byte
- func SearializeMetaDocument(doc metaDocumentType) []byte
- func SizeOfImg(fn string) (h, w float64)
- func Table(pdf *gofpdf.Fpdf, tbl [][]string) *gofpdf.Fpdf
- type DocImageProcType
- func (hdlr *DocImageProcType) GeneratePDF(TheDoc documentType, DocHash []byte, documentID, categoryID string, ...) (pdfFn string, err error)
- func (hdlr *DocImageProcType) InitializeWithConfigData(next http.Handler, gCfg *cfg.ServerGlobalConfigType, serverName string, ...) (err error)
- func (hdlr *DocImageProcType) PreValidate(gCfg *cfg.ServerGlobalConfigType, cfgData map[string]interface{}, ...) (err error)
- func (hdlr *DocImageProcType) RedisPushQ(key, someData string)
- func (hdlr *DocImageProcType) ServeHTTP(www http.ResponseWriter, req *http.Request)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CopyFile ¶
CopyFile copies a file from src to dst. If src and dst files exist, and are the same, then return success. Otherise, attempt to create a hard link between the two files. If that fail, copy the file contents from src to dst.
func GetFilenames ¶
GetFilenames returns a slize of files and directories for the specified path.
func HashImages ¶
func HashImages(imageList []imageTypeList) []byte
func HashStrngOf ¶
HashStringOf calcualtes the hash of the 'data' and returns it.
func HashStrngOfReturnHex ¶
HashStringOfReturnHex calcualtes the hash of the 'data' and returns it.
func InsertImage ¶
InsertImage adds an image to the document on the current page. The image will be sized to fit in the page.
func Keccak256 ¶
Keccak256 use the Ethereum Keccak hasing fucntions to return a hash from a list of values.
func MerkleHash ¶
MerkleHash calcualtes a Merkle tree hash for the [][]byte input.
func MerkleLeaves ¶
MerkleLeaves calculates the hash of the passed leaf hashes.
func SearializeDocumentType ¶
func SearializeDocumentType(dt documentType) []byte
SearializeDocumentType searalizes a documentType for hashing.
func SearializeMetaDocument ¶
func SearializeMetaDocument(doc metaDocumentType) []byte
SearializeMetaDocumentType searalizes a metaDocumentType for hashing.
Types ¶
type DocImageProcType ¶
type DocImageProcType struct { Next http.Handler // Paths []string // RedisPrefix string // InputPath string // OutputPath string // OutputURL string // ArchivePath string // IsProd string // RedisQ string // Q that push to Geth is put on. RedisGetQ string // Signal to outside world that data is ready. ((incomplete)) GetEventURL string // URL to do GET on to signal that data is ready. ((incomplete)) RedisID string // ID to increment for temp file names SingedOnceAddr string // Address of loaded proxy contract AppID string // ID of this app LineNo int // // contains filtered or unexported fields }
func NewDocImageProcTypeServer ¶
func NewDocImageProcTypeServer(n http.Handler, p []string, redisPrefix, realm string) *DocImageProcType
NewDocImageProcTypeServer will create a copy of the server for testing.
func (*DocImageProcType) GeneratePDF ¶
func (*DocImageProcType) InitializeWithConfigData ¶
func (hdlr *DocImageProcType) InitializeWithConfigData(next http.Handler, gCfg *cfg.ServerGlobalConfigType, serverName string, pNo, callNo int) (err error)
func (*DocImageProcType) PreValidate ¶
func (hdlr *DocImageProcType) PreValidate(gCfg *cfg.ServerGlobalConfigType, cfgData map[string]interface{}, serverName string, pNo, callNo int) (err error)
func (*DocImageProcType) RedisPushQ ¶
func (hdlr *DocImageProcType) RedisPushQ(key, someData string)
func (*DocImageProcType) ServeHTTP ¶
func (hdlr *DocImageProcType) ServeHTTP(www http.ResponseWriter, req *http.Request)