groups

package
v0.0.0-...-d7353a2 Latest Latest
Warning

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

Go to latest
Published: May 3, 2024 License: Apache-2.0 Imports: 18 Imported by: 0

Documentation

Overview

Package groups contains Groups server implementation.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AuthGroupsProvider

type AuthGroupsProvider interface {
	GetAllAuthGroups(ctx context.Context) ([]*model.AuthGroup, error)
	RefreshPeriodically(ctx context.Context)
}

AuthGroupsProvider is the interface to get all AuthGroup entities.

type AuthGroupsSnapshot

type AuthGroupsSnapshot struct {
	// contains filtered or unexported fields
}

type CachingGroupsProvider

type CachingGroupsProvider struct {
	// contains filtered or unexported fields
}

func (*CachingGroupsProvider) GetAllAuthGroups

func (cgp *CachingGroupsProvider) GetAllAuthGroups(ctx context.Context) (groups []*model.AuthGroup, err error)

func (*CachingGroupsProvider) RefreshPeriodically

func (cgp *CachingGroupsProvider) RefreshPeriodically(ctx context.Context)

RefreshPeriodically runs a loop that periodically refreshes the cached snapshot of AuthGroups.

type Server

type Server struct {
	rpcpb.UnimplementedGroupsServer
	// contains filtered or unexported fields
}

Server implements Groups server.

func NewServer

func NewServer(dryRun bool) *Server

func (*Server) CreateGroup

func (srv *Server) CreateGroup(ctx context.Context, request *rpcpb.CreateGroupRequest) (*rpcpb.AuthGroup, error)

CreateGroup implements the corresponding RPC method.

func (*Server) DeleteGroup

func (srv *Server) DeleteGroup(ctx context.Context, request *rpcpb.DeleteGroupRequest) (*emptypb.Empty, error)

DeleteGroup implements the corresponding RPC method.

func (*Server) GetGroup

func (*Server) GetGroup(ctx context.Context, request *rpcpb.GetGroupRequest) (*rpcpb.AuthGroup, error)

GetGroup implements the corresponding RPC method.

func (*Server) GetSubgraph

func (srv *Server) GetSubgraph(ctx context.Context, request *rpcpb.GetSubgraphRequest) (*rpcpb.Subgraph, error)

GetSubgraph implements the corresponding RPC method.

Possible Errors:

Internal error for datastore access issues.
NotFound error wrapping a graph.ErrNoSuchGroup if group is not present in groups graph.
InvalidArgument error if the PrincipalKind is unspecified.
Annotated error if the subgraph building fails, this may be an InvalidArgument or NotFound error.

func (*Server) ListGroups

func (srv *Server) ListGroups(ctx context.Context, _ *emptypb.Empty) (*rpcpb.ListGroupsResponse, error)

ListGroups implements the corresponding RPC method.

func (*Server) RefreshPeriodically

func (srv *Server) RefreshPeriodically(ctx context.Context)

RefreshPeriodically wraps the groups provider's refresh method.

func (*Server) UpdateGroup

func (srv *Server) UpdateGroup(ctx context.Context, request *rpcpb.UpdateGroupRequest) (*rpcpb.AuthGroup, error)

UpdateGroup implements the corresponding RPC method.

func (*Server) Warmup

func (srv *Server) Warmup(ctx context.Context)

Warmup does the setup for the groups server; it should be called before the main serving loop.

Jump to

Keyboard shortcuts

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