go/

directory
v0.0.0-...-08a0a91 Latest Latest
Warning

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

Go to latest
Published: Feb 14, 2025 License: Apache-2.0

README

Federation Go Packages

Core implementation packages for building Federation services in Go.

Package Structure

pkg/go/
├── auth/          # Authentication and authorization
├── interconnectprovider/  # Core Federation Interconnect service implementation
├── handler/       # Federation service interfaces
└── server/        # Server implementations

Core Components

Authentication (auth/)

Provides JWT-based authentication for gRPC services:

  • Server interceptors for unary and streaming RPCs
  • JWT validation and verification
  • RSA public/private key pair support
Interconnect Provider (interconnectprovider/)

Core implementation of the Interconnect service:

  • Service lifecycle management
  • Configuration handling
  • Server component coordination
Handler Framework (handler/)

Interface definitions for implementing Interconnect Federation services:

  • InterconnectHandler interface
  • Support for service scheduling
  • Monitoring capabilities
  • Service cancellation
Server Components (server/)

Complete server implementations:

  • gRPC server for Interconnect API
  • Channelz server for monitoring/introspection
  • pprof server for profiling
  • Generic Server interface
  • Graceful shutdown support

Building with Bazel

Common Bazel commands:

# Build all packages
bazel build //pkg/go/...

# Run all tests
bazel test //pkg/go/...

# Build specific component
bazel build //pkg/go/interconnectprovider

Usage

To use these packages in your own Federation service:

  1. Import the required packages:
import (
    "github.com/outernetcouncil/federation/pkg/go/auth"
    "github.com/outernetcouncil/federation/pkg/go/interconnectprovider"
    "github.com/outernetcouncil/federation/pkg/go/handler"
    "github.com/outernetcouncil/federation/pkg/go/server"
)
  1. Implement the InterconnectHandler interface
  2. Configure authentication as needed
  3. Create and start server components

For a complete implementation example, see the examples/golang/simpleinterconnectprovider directory.

References

Directories

Path Synopsis
package handler defines the interface for handling Interconnect gRPC requests.
package handler defines the interface for handling Interconnect gRPC requests.
Package InterconnectProvider provides an Interconnect Provider, a Federation gRPC bridge to RESTFUL Providers.
Package InterconnectProvider provides an Interconnect Provider, a Federation gRPC bridge to RESTFUL Providers.

Jump to

Keyboard shortcuts

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