Skip to content

way-platform/tachograph-go

Repository files navigation

Tachograph Go

PkgGoDev GoReportCard CI

A Go SDK and CLI tool for working with Tachograph data (.DDD files).

Specification

This SDK implements parsing of downloaded tachograph data, according to the requirements for the construction, testing, installation, operation and repair of tachographs and their components.

Features

This library provides a comprehensive set of tools for working with Tachograph data, from raw binary parsing to anonymization and serialization.

// 1. Unmarshal the raw .DDD file content into a RawFile object.
rawFile, err := tachograph.Unmarshal(dddBytes)
if err != nil {
    log.Fatalf("failed to unmarshal: %v", err)
}

// 2. Authenticate the signatures within the RawFile.
authenticatedRawFile, err := tachograph.Authenticate(context.Background(), rawFile)
if err != nil {
    log.Fatalf("failed to authenticate: %v", err)
}

// 3. Parse the authenticated RawFile into a File.
parsedFile, err := tachograph.Parse(authenticatedRawFile)
if err != nil {
    log.Fatalf("failed to parse: %v", err)
}

// 4. Anonymize personal data in the parsed File.
anonymizedFile, err := tachograph.Anonymize(parsedFile)
if err != nil {
    log.Fatalf("failed to anonymize: %v", err)
}

// 5. Marshal the file back into the binary .DDD format.
marshalledBytes, err := tachograph.Marshal(anonymizedFile)
if err != nil {
    log.Fatalf("failed to marshal: %v", err)
}

Unmarshalling

tachograph.Unmarshal parses raw .DDD byte arrays into a tachographv1.RawFile object.

Authenticating

tachograph.Authenticate cryptographically verifies the signatures within a tachographv1.RawFile.

Parsing

tachograph.Parse turns a tachographv1.RawFile into a tachographv1.File, with meaningful, high-level structures like driver activities and events, making the data easy to analyze.

Anonymizing

tachograph.Anonymize removes or obscures personal data from a tachographv1.File - making the data usable for unit testing

Marshalling

tachograph.Marshal serializes a tachographv1.File back into the binary .DDD format.

CLI

$ tachograph

  Tachograph CLI

  USAGE

    tachograph [command] [--flags]

  .DDD FILES

    parse [file ...] [--flags]  Parse .DDD files

  UTILS

    completion [command]        Generate the autocompletion script for the specified shell
    help [command]              Help about any command

  FLAGS

    -h --help                   Help for tachograph
    -v --version                Version for tachograph

Alternatives

This SDK draws inspiration from other tachograph SDKs, including:

About

Go SDK for tachograph (.DDD) files

Topics

Resources

License

Code of conduct

Security policy

Stars

Watchers

Forks

Languages