Coder Social home page Coder Social logo

godata's Introduction

GoData

This is an implementation of OData in Go. It is capable of parsing an OData request, and exposing it in a standard way so that any provider can consume OData requests and produce a response. Providers can be written for general usage like producing SQL statements for a databases, or very specific uses like connecting to another API.

Most OData server frameworks are C#/.NET or Java. These require using the CLR or JVM, and are overkill for a lot of use cases. By using Go we aim to provide a lightweight, fast, and concurrent OData service. By exposing a generic interface to an OData request, we hope to enable any backend to expose itself with an OData API with as little effort as possible.

Status

This project is not finished yet, and cannot be used in its current state. Progress is underway to make it usable, and eventually fully compatible with the OData V4 specification.

Work in Progress

  • Parse OData URLs
  • Create provider interface for GET requests
  • Parse OData POST and PATCH requests
  • Create provider interface for POST and PATCH requests
  • Parse OData DELETE requests
  • Create provider interface for PATCH requests
  • Allow injecting middleware into the request pipeline to enable such features as caching, authentication, telemetry, etc.
  • Work on fully supporting the OData specification with unit tests

Feel free to contribute with any of these tasks.

High Level Architecture

If you're interesting in helping out, here is a quick introduction to the code to help you understand the process. The code works something like this:

  1. A provider is initialized that defines the object model (i.e., metadata), of the OData service. (See the example directory.)
  2. An HTTP request is received by the request handler in service.go
  3. The URL is parsed into a data structure defined in request_model.go
  4. The request model is semanticized, so each piece of the request is associated with an entity/type/collection/etc. in the provider object model.
  5. The correct method and type of request (entity, collection, $metadata, $ref, property, etc.) is determined from the semantic information.
  6. The request is then delegated to the appropriate method of a GoDataProvider, which will produce a response based on the semantic information, and package it into a response defined in response_model.go.
  7. The response is converted to JSON and sent back to the client.

godata's People

Contributors

sebastien-rosset avatar kboreddy avatar rykov avatar parvathi-nair avatar

Watchers

James Cloos avatar  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.