server

package
v0.0.2 Latest Latest
Warning

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

Go to latest
Published: Jun 6, 2022 License: Apache-2.0 Imports: 28 Imported by: 0

Documentation

Index

Constants

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

Variables

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

Functions

This section is empty.

Types

type Config

type Config struct {
	ServiceName            string
	RPCPort                int
	HTTPPort               int
	ResolveNodeLimit       uint32
	ChangelogHorizonOffset int
	UnaryInterceptors      []grpc.UnaryServerInterceptor
	MuxOptions             []runtime.ServeMuxOption
	RequestTimeout         time.Duration
}

type Dependencies

type Dependencies struct {
	Datastore     storage.OpenFGADatastore
	Tracer        trace.Tracer
	Meter         metric.Meter
	Logger        logger.Logger
	Authenticator authentication.Authenticator

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

type Server

type Server struct {
	openfgapb.UnimplementedOpenFGAServiceServer
	*grpc.Server
	// 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) Close

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

Close gracefully stops this server, blocking any subsequent requests and waiting for any existing ones to complete before returning.

func (*Server) CreateStore

func (*Server) DeleteStore

func (*Server) Expand

func (*Server) GetStore

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 serverErrors.

func (*Server) Write

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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