Documentation ¶
Overview ¶
bns project bns.go
Index ¶
- Constants
- func BuildConvalArray(inputFile string) (*[]Conval, error)
- func BuildDirectoryArray(inputFile string) (*[]Directory, error)
- func BuildUsermd(v Conval) (map[string]string, error)
- func CheckST33Length(v *Conval, r *St33Reader, buf []byte) error
- func CopyObject(key string, svc *s3.S3, frombucket string, tobucket string) error
- func CopyObjects(key string, pages int, svc *s3.S3, frombucket string, tobucket string)
- func GetMagic(id string) string
- func GetOrientation(rotation_code []byte) uint16
- func Getuint16(in []byte) uint16
- func Getuint32(in []byte) uint32
- func IsST33Blob(buf []byte, k int64) bool
- func NewPxiBlob(key string, records int) *pxiBlob
- func RewindST33(v Conval, r *St33Reader, diff int)
- func SetTiffImageCompression(buffer *bytes.Buffer, enc binary.ByteOrder) error
- func SetTiffImageLength(buffer *bytes.Buffer, enc binary.ByteOrder, width []byte) error
- func SetTiffImageOrientation(buffer *bytes.Buffer, enc binary.ByteOrder, rotationCode []byte) error
- func SetTiffImagePhotometric(buffer *bytes.Buffer, enc binary.ByteOrder) error
- func SetTiffImageResolutionUnit(buffer *bytes.Buffer, resolution []byte, enc binary.ByteOrder) error
- func SetTiffImageStripByteCount(buffer *bytes.Buffer, enc binary.ByteOrder, totalLength uint32) error
- func SetTiffImageStripOffset(buffer *bytes.Buffer, enc binary.ByteOrder) error
- func SetTiffImageWidth(buffer *bytes.Buffer, enc binary.ByteOrder, width []byte) error
- func SetTiffImageXresolution(buffer *bytes.Buffer, enc binary.ByteOrder) error
- func SetTiffImageYresolution(buffer *bytes.Buffer, enc binary.ByteOrder) error
- func SetTiffMagicNumber(buffer *bytes.Buffer, enc binary.ByteOrder) error
- func SkipST33(v Conval, r *St33Reader, diff int)
- func ToFilesV1(ifile string, odir string, bdir string, test bool) (int, int, int, int, error)
- func WriteImgToFile(pathname string, img *bytes.Buffer) error
- func WriteUsermd(metad map[string]string, pathname string) error
- type Conval
- type Directory
- type PutS3Response
- type PxiImg
- func (image *PxiImg) BuildTiffImage(r *St33Reader, v Conval, cp int) (int, error, error)
- func (image *PxiImg) BuildTiffImageV2(r *St33Reader, v Conval, cp int) (int, error, error)
- func (image *PxiImg) GetDataType() []byte
- func (image *PxiImg) GetImage() *bytes.Buffer
- func (image *PxiImg) GetPageNum() []byte
- func (image *PxiImg) GetPxiId() []byte
- func (image *PxiImg) GetRefNum() []byte
- func (image *PxiImg) SetPxiId(p []byte)
- type PxiMeta
- type Request
- type Response
- type S3Error
- type St33Reader
- type St33ToS3
- type Tiff
- type ToS3GetPages
- type ToS3Request
- type ToS3Response
- type UserMd
Constants ¶
View Source
const ( Bib string = "BB" // Biblio Abs string = "AB" // Abstrcat Cla string = "CL" // Claims Dra string = "DR" // Drawing Amd string = "AM" // Amendement Des string = "DE" // Description Srp string = "SR" // Search Report Dna string = "DN" // DNA Aci string = "AC" // Application citation Max_page int = 1000 // maximum subpage )
View Source
const ( ToFile int = 1 ToS3 int = 2 TIFF string = "pxi/tiff" )
View Source
const ( DATval string = "datval" CONval string = "conval" DIRval string = "dir_datval" )
View Source
const ( ST33RAMReader string = "RAM" ST33FILEReader string = "FILE" PartiallyUploaded string = "Partially Uploaded" Started string = "Started" FullyUploaded string = "Fully Uploaded" FullyUploaded2 string = "Fully Uploaded with some input data inconsistency" TwoGB int64 = 2 * 1024 * 1024 LOOP int = 10 /* number of loop to skip bad records */ )
View Source
const (
Tiff_header_size = 160 // 0xA0
)
Variables ¶
This section is empty.
Functions ¶
func BuildConvalArray ¶
func BuildDirectoryArray ¶
func CheckST33Length ¶
func CheckST33Length(v *Conval, r *St33Reader, buf []byte) error
func CopyObjects ¶
func IsST33Blob ¶
func NewPxiBlob ¶
func RewindST33 ¶
func RewindST33(v Conval, r *St33Reader, diff int)
func SetTiffImageCompression ¶
12 bytes
func SetTiffImageLength ¶
12 bytes
func SetTiffImageOrientation ¶
func SetTiffImagePhotometric ¶
12 bytes
func SetTiffImageResolutionUnit ¶
func SetTiffImageResolutionUnit(buffer *bytes.Buffer, resolution []byte, enc binary.ByteOrder) error
12 bytes
func SetTiffImageStripByteCount ¶
func SetTiffImageStripByteCount(buffer *bytes.Buffer, enc binary.ByteOrder, totalLength uint32) error
12 bytes
func SetTiffImageStripOffset ¶
12 bytes
func SetTiffImageWidth ¶
12 bytes
func SetTiffImageXresolution ¶
func SetTiffImageYresolution ¶
func SkipST33 ¶
func SkipST33(v Conval, r *St33Reader, diff int)
Types ¶
type Conval ¶
type Conval struct { PxiId string `json:"pxiId"` PubDate string `json:"pubDate"` ScanDate string `json:"scanDate"` Pages uint32 `json:"numPages"` Records int `json:"numRecords,omitempty"` DocSize uint32 `json:"docSize"` Status string `json:"status"` Revisory string `json:"revisory"` Copyright string `json:"copyright"` Quality string `json:"quality,omitempty"` }
type PxiImg ¶
type PxiImg struct { PxiId []byte PageNum []byte RefNum []byte Img *bytes.Buffer DataType []byte NumPages []byte }
func (*PxiImg) BuildTiffImage ¶
func (*PxiImg) BuildTiffImageV2 ¶
func (*PxiImg) GetDataType ¶
func (*PxiImg) GetPageNum ¶
type PxiMeta ¶
type PxiMeta struct { PxiId string PageNum string RefNum string DataType string Bucket string NumPages int }
func (*PxiMeta) GetNumPages ¶
type S3Error ¶
func ToS3V1Async ¶
func ToS3V1Parallel ¶
Process one document at a time N pages of the document will be uploaded concurrently
type St33Reader ¶
func NewSt33Reader ¶
func NewSt33Reader(infile string) (*St33Reader, error)
func (*St33Reader) ReadST33BLOB ¶
func (r *St33Reader) ReadST33BLOB(v Conval)
func (*St33Reader) ReadST33Blob ¶
func (r *St33Reader) ReadST33Blob(rdw int) ([]byte, error)
special Read
func (*St33Reader) ReadST33Tiff ¶
type St33ToS3 ¶
type St33ToS3 struct { Request ToS3Request `json:"request"` Response ToS3Response `json:"response"` }
type ToS3GetPages ¶
type ToS3GetPages struct { KEY string Req *ToS3Request CP int Step int R *St33Reader V Conval Svc *s3.S3 }
type ToS3Request ¶
type ToS3Request struct { File string `json:"input-file"` Bucket string `json:"target-bucket"` Number int `json:"number-of-bucket"` LogBucket string `json:"logging-bucket"` DatafilePrefix string `json:"data-file-prefix"` CrlfilePrefix string `json:"control-file-prefix"` Profiling int `json:"run-with-profiling"` Reload bool `json:"reload"` Async int `json:"run-with-concurrent-number"` Check bool `json:"check"` }
type ToS3Response ¶
type ToS3Response struct { Time time.Time `json:"ended-time"` Status string `json:"uploaded-status"` // upload status Duration string `json:"time-to-uploaded"` // duration of the process Docs int `json:"number-of-documents"` // number of documenst Pages int `json:"number-of-pages"` // number of pages Size int `json:"total-uploaded-size"` // total uploaded size Erroru int `json:"number-of-uploaded-errors"` // number of uploaded errors Errori int `json:"number-of-other-errors"` // number of uploaded errors }
Click to show internal directories.
Click to hide internal directories.