Skip to content

Latest commit

 

History

History
72 lines (51 loc) · 2.61 KB

File metadata and controls

72 lines (51 loc) · 2.61 KB

Golang language bindings for NeTEx

This library aims to provides basic NeTEx bindings for golang that are more readable and intuitive to use than auto-generated ones. It is intended to be used with the golang encoding/xml library both for marshalling and unmarshalling

It is currently a partial implementation, based on the Italian profile, developed alongside our Transmodel API, and only covers it's use cases.

That being said, we warmly welcome contributions to bring this towards complete NeTEx coverage.

If you need any fields/structs that are not implemented yet, please open an Issue or a PR and we'll do our best to add it

Usage

go get github.com/noi-techpark/go-netex

Use the provided structs with xml.Marshal and xml.Unmarshal

The root element is netex.PublicationDelivery

Marshal

	delivery := netex.PublicationDelivery{}
    // ... populate
	err = xml.Marshal(data, &delivery)
	bytes, err := xml.Marshal(fleet)

Unmarshal

	data, err := os.ReadFile("netex.xml")

	var delivery netex.PublicationDelivery
	err = xml.Unmarshal(data, &delivery)

Timestamps

NeTEx uses ISO 8601 as timestamp format, which means lots of missing location information that needs special handling.
We just give you the raw strings, you can use time.Time.String() to populate as it's valid ISO 8601

Information

Support

For support, please contact help@opendatahub.com.

Contributing

If you'd like to contribute, please follow our Getting Started instructions.

License

The code in this project is licensed under Mozilla Public License Version 2.0

REUSE

This project is REUSE compliant, more information about the usage of REUSE in NOI Techpark repositories can be found here.

Since the CI for this project checks for REUSE compliance you might find it useful to use a pre-commit hook checking for REUSE compliance locally. The pre-commit-config file in the repository root is already configured to check for REUSE compliance with help of the pre-commit tool.

Install the tool by running:

pip install pre-commit

Then install the pre-commit hook via the config file by running:

pre-commit install