api

package
v0.2300.8 Latest Latest
Warning

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

Go to latest
Published: Nov 29, 2023 License: Apache-2.0 Imports: 6 Imported by: 3

Documentation

Overview

Package api implements the sentry backend API.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func RegisterService

func RegisterService(server *grpc.Server, service Backend)

RegisterService registers a new sentry service with the given gRPC server.

Types

type Backend

type Backend interface {
	// Get addresses returns the list of consensus and TLS addresses of the sentry node.
	GetAddresses(context.Context) (*SentryAddresses, error)
}

Backend is a sentry backend implementation.

func NewSentryClient

func NewSentryClient(c *grpc.ClientConn) Backend

NewSentryClient creates a new gRPC sentry client service.

type SentryAddresses

type SentryAddresses struct {
	Consensus []node.ConsensusAddress `json:"consensus"`
}

SentryAddresses contains sentry node consensus and TLS addresses.

type ServicePolicies

type ServicePolicies struct {
	Service        grpc.ServiceName                      `json:"service"`
	AccessPolicies map[common.Namespace]accessctl.Policy `json:"access_policies"`
}

ServicePolicies contains policies for a GRPC service.

Jump to

Keyboard shortcuts

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