serviceregistry

package
v0.0.0-...-1ac4089 Latest Latest
Warning

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

Go to latest
Published: Apr 28, 2024 License: BSD-3-Clause-Clear Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var RegisteredServices map[string]map[string]Service

Map of namespaces to services

Functions

func RegisterService

func RegisterService(r Registration) error

Types

type HandlerServer

type HandlerServer func(ctx context.Context, mux *runtime.ServeMux, server any) error

type RegisterFunc

type RegisterFunc func(RegistrationParams) (Impl any, HandlerServer HandlerServer)

type Registration

type Registration struct {
	Namespace    string
	ServiceDesc  *grpc.ServiceDesc
	RegisterFunc RegisterFunc
}

type RegistrationParams

type RegistrationParams struct {
	Config          ServiceConfig
	OTDF            *server.OpenTDFServer
	DBClient        *db.Client
	Engine          *opa.Engine
	SDK             *sdk.SDK
	WellKnownConfig func(namespace string, config any) error
}

type RemoteServiceConfig

type RemoteServiceConfig struct {
	Endpoint string `yaml:"endpoint"`
}

type Service

type Service struct {
	Registration
}

type ServiceConfig

type ServiceConfig struct {
	Enabled    bool                   `yaml:"enabled"`
	Remote     RemoteServiceConfig    `yaml:"remote"`
	ExtraProps map[string]interface{} `json:"-" mapstructure:",remain"`
}

Jump to

Keyboard shortcuts

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