github.com/CiscoM31/godata@v1.0.10/README.md (about)

     1  [![Go](https://github.com/CiscoM31/godata/actions/workflows/go.yml/badge.svg)](https://github.com/CiscoM31/godata/actions/workflows/go.yml)
     2  [![golangci-lint](https://github.com/CiscoM31/godata/actions/workflows/golangci-lint.yml/badge.svg)](https://github.com/CiscoM31/godata/actions/workflows/golangci-lint.yml)
     3  
     4  GoData
     5  ======
     6  
     7  This is an implementation of OData in Go. It is capable of parsing an OData
     8  request, and exposing it in a standard way so that any provider can consume
     9  OData requests and produce a response. Providers can be written for general
    10  usage like producing SQL statements for a databases, or very specific uses like
    11  connecting to another API.
    12  
    13  Most OData server frameworks are C#/.NET or Java. These require using the CLR or
    14  JVM, and are overkill for a lot of use cases. By using Go we aim to provide a
    15  lightweight, fast, and concurrent OData service. By exposing a generic interface
    16  to an OData request, we hope to enable any backend to expose itself with
    17  an OData API with as little effort as possible.
    18  
    19  Status
    20  ======
    21  
    22  This project is not finished yet, and cannot be used in its current state.
    23  Progress is underway to make it usable, and eventually fully compatible with the
    24  OData V4 specification.
    25  
    26  Work in Progress
    27  ================
    28  
    29  * ~~Parse OData URLs~~
    30  * Create provider interface for GET requests
    31  * Parse OData POST and PATCH requests
    32  * Create provider interface for POST and PATCH requests
    33  * Parse OData DELETE requests
    34  * Create provider interface for PATCH requests
    35  * Allow injecting middleware into the request pipeline to enable such features
    36    as caching, authentication, telemetry, etc.
    37  * Work on fully supporting the OData specification with unit tests
    38  
    39  Feel free to contribute with any of these tasks.
    40  
    41  High Level Architecture
    42  =======================
    43  
    44  If you're interesting in helping out, here is a quick introduction to the
    45  code to help you understand the process. The code works something like this:
    46  
    47  1. A provider is initialized that defines the object model (i.e., metadata), of
    48     the OData service. (See the example directory.)
    49  2. An HTTP request is received by the request handler in service.go
    50  3. The URL is parsed into a data structure defined in request_model.go
    51  4. The request model is semanticized, so each piece of the request is associated
    52     with an entity/type/collection/etc. in the provider object model.
    53  5. The correct method and type of request (entity, collection, $metadata, $ref, 
    54     property, etc.) is determined from the semantic information.
    55  6. The request is then delegated to the appropriate method of a GoDataProvider,
    56     which will produce a response based on the semantic information, and
    57     package it into a response defined in response_model.go.
    58  7. The response is converted to JSON and sent back to the client.