Code Monkey home page Code Monkey logo

dlis's Introduction

Reading and writing DLIS in go

Spec: http://w3.energistics.org/rp66/v1/Toc/main.html

NEXT

Re-write in maplang

Use abuse maps: - maps make it clear if something is missing

Think about the run.go Run(*V) *V, how does it work? It takes a *V which is slice of *V and think of them as one feeding the other. Values are simply get imbeded into the next?

Let code deal with io.Reader, *V deals only with []byte to values

Default value objects are closures, that generate default value.

Overhaul to keep the io.Reader around. LRS is a temporary transient structure that needs to go away. Need to get to object data as soon as possible.

Start overhaul with SUL.

eflr_parse.go - parseSet() must build the actual template to follow by the object.

How object would use the Template? How does attrib know it parces Template or object?

Once object data gets parsed just throw it into a chan with large buffer, on the other side collect it for disk persistance asap. Try to stay as wait free as possible.

older notes

repcode.go - use the funcs from RepCode var to build up the template.

reader.go - start with NewDLISReader() reading SUL as example. Everything is constructed as simple sequence of func(in []byte) (Val, int). Val is universal value type. Calling function must know the expected return type.

How to read the code

reader.go

Everything starts with reader.go NewDLISReader() which takes an io.Reader and returns dlis.Reader. Use ReadVR() of dlis.Reader to get next Visible Record. Then ReadLRS() to get next Logical Record Segment. (See example in reader_test.go).

IDEA

Construct the reader for each part as sequence of the functions based on the either predefined format as per spec, or construct it at run time based on the data read from the dlis. Such that prior data defines next reader.

dlis's People

Contributors

k1m190r avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.