cnwan-reader

command module
v0.3.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 26, 2021 License: Apache-2.0 Imports: 1 Imported by: 0

README

GitHub GitHub go.mod Go version OpenAPI version GitHub Workflow Status GitHub release (latest by date) Docker Image Version (latest by date)

CNWAN Reader

CN-WAN Reader watches a service registry for changes and sends events to an external handler for processing.

The CN-WAN Reader is part of the Cloud Native SD-WAN (CN-WAN) project. Please check the CN-WAN documentation for the general project overview and architecture. You can contact the CN-WAN team at cnwan@cisco.com.

Overview

The CN-WAN Reader makes use of the service discovery pattern by connecting to a service registry and observing changes in published services/endpoints. Detected changes are then processed and sent as events to an adaptor, which can be created following the OpenAPI specification included in this repository.

Please follow this readme to know more about OpenAPI, Adaptors and Supported Service Registries.

Supported Service Registries

Currently, the CN-WAN Reader can discover services/endpoints published to Google Cloud's Service directory.

In order to connect correctly, a service account is needed.
To learn more about Google Cloud Service Accounts, you can also consult this guide. Finally, you can read Service Directory's documentation to know more about how it works.

Documentation

To learn how to install or use the program, please follow documentation provided in the docs directory.

You can start by reading Installation or Docker Installation if you want to install and run the program inside a docker container.

OpenAPI Specification

The CN-WAN Reader acts as a client, sending detected changes in form of events to an external handler - an Adaptor - for processing. Therefore, any program interested in receiving and processing these events must generate the server code starting from the OpenAPI specification, or you can just implement the appropriate endpoint in your already existing server.

The specification, along with documentation on what you need to implement and what data is sent by the CN-WAN Reader, is included in this repository at this link.

To learn more about OpenAPI please take a look at this repository.
To generate your code, you can use the OpenAPI Generator.

Contributing

Thank you for interest in contributing to this project.
Before starting, please make sure you know and agree to our Code of conduct.

  1. Fork it
  2. Download your fork
    git clone https://github.com/your_username/cnwan-reader && cd cnwan-reader
  3. Create your feature branch
    git checkout -b my-new-feature
  4. Make changes and add them
    git add .
  5. Commit your changes
    git commit -m 'Add some feature'
  6. Push to the branch
    git push origin my-new-feature
  7. Create new pull request to this repository

License

CN-WAN Reader is released under the Apache 2.0 license. See LICENSE

Documentation

The Go Gopher

There is no documentation for this package.

Directories

Path Synopsis
Package cmd contains code that is executed by a given command from the CLI.
Package cmd contains code that is executed by a given command from the CLI.
pkg
openapi
Package openapi contains *client* code that has been auto-generated by OpenAPI generator and sends events to an external handler as specified in the OpenAPI specification included in /api.
Package openapi contains *client* code that has been auto-generated by OpenAPI generator and sends events to an external handler as specified in the OpenAPI specification included in /api.
poller
Package poller contains code that is in charge of periodically executing a given function every x seconds, where x is a customizable parameter.
Package poller contains code that is in charge of periodically executing a given function every x seconds, where x is a customizable parameter.
queue
Package queue is in charge of creating and handling a queue that receives data and sends it in bulk whenever it is possible, i.e.
Package queue is in charge of creating and handling a queue that receives data and sends it in bulk whenever it is possible, i.e.
sdhandler
Package sdhandler includes code that connects to Google Cloud Service Directory and performs different operations on its resources, such as creating a namespace, updating a service, deleting and endpoint etc.
Package sdhandler includes code that connects to Google Cloud Service Directory and performs different operations on its resources, such as creating a namespace, updating a service, deleting and endpoint etc.
services
Package services is all about handling services: from storing the latest data of a service to providing a interface for the openapi client code contained in pkg/openapi.
Package services is all about handling services: from storing the latest data of a service to providing a interface for the openapi client code contained in pkg/openapi.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL