server

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Aug 15, 2022 License: Apache-2.0 Imports: 32 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

View Source
const (
	AuthorizationModelIDHeader = "openfga-authorization-model-id"
)

Variables

View Source
var (
	ErrNilTokenEncoder = fmt.Errorf("tokenEncoder must be a non-nil interface value")
	ErrNilTransport    = fmt.Errorf("transport must be a non-nil interface value")
)

Functions

func NewOpenFGAServerHealthChecker added in v0.1.5

func NewOpenFGAServerHealthChecker(s *Server) health.HealthCheckManager

NewOpenFGAServerHealthChecker constructs a HealthCheckManager that can be used to report the health status of the provided OpenFGA server.

Types

type Config

type Config struct {
	GRPCServer             GRPCServerConfig
	HTTPServer             HTTPServerConfig
	ResolveNodeLimit       uint32
	ChangelogHorizonOffset int
	ListObjectsDeadline    time.Duration
	ListObjectsMaxResults  uint32
	UnaryInterceptors      []grpc.UnaryServerInterceptor
	MuxOptions             []runtime.ServeMuxOption
}

type Dependencies

type Dependencies struct {
	Datastore storage.OpenFGADatastore
	Tracer    trace.Tracer
	Meter     metric.Meter
	Logger    logger.Logger
	Transport gateway.Transport

	// TokenEncoder is the encoder used to encode continuation tokens for paginated views.
	// Defaults to a base64 encoder if none is provided.
	TokenEncoder encoder.Encoder
}

type GRPCServerConfig added in v0.1.1

type GRPCServerConfig struct {
	Addr      string
	TLSConfig *TLSConfig
}

type HTTPServerConfig added in v0.1.1

type HTTPServerConfig struct {
	Enabled            bool
	Addr               string
	UpstreamTimeout    time.Duration
	TLSConfig          *TLSConfig
	CORSAllowedOrigins []string
	CORSAllowedHeaders []string
}

type Server

type Server struct {
	openfgapb.UnimplementedOpenFGAServiceServer
	// contains filtered or unexported fields
}

A Server implements the OpenFGA service backend as both a GRPC and HTTP server.

func New

func New(dependencies *Dependencies, config *Config) (*Server, error)

New creates a new Server which uses the supplied backends for managing data.

func (*Server) Check

func (*Server) CreateStore

func (*Server) DeleteStore

func (*Server) Expand

func (*Server) GetStore

func (*Server) IsReady added in v0.1.5

func (s *Server) IsReady(ctx context.Context) (bool, error)

IsReady reports whether this OpenFGA server instance is ready to accept traffic.

func (*Server) ListObjects added in v0.2.0

func (*Server) ListStores

func (*Server) Read

func (*Server) ReadChanges

func (*Server) ReadTuples

func (*Server) Run

func (s *Server) Run(ctx context.Context) error

Run starts server execution, and blocks until complete, returning any server errors. To close the server cancel the provided ctx.

func (*Server) StreamedListObjects added in v0.2.0

func (*Server) Write

type TLSConfig added in v0.1.1

type TLSConfig struct {
	CertPath string
	KeyPath  string
}

Directories

Path Synopsis
Package health provides interfaces and mechanisms to implement server health checks.
Package health provides interfaces and mechanisms to implement server health checks.

Jump to

Keyboard shortcuts

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