Documentation ¶
Overview ¶
Package groups contains Groups server implementation.
Index ¶
- type AuthGroupsProvider
- type AuthGroupsSnapshot
- type CachingGroupsProvider
- type Server
- func (srv *Server) CreateGroup(ctx context.Context, request *rpcpb.CreateGroupRequest) (*rpcpb.AuthGroup, error)
- func (srv *Server) DeleteGroup(ctx context.Context, request *rpcpb.DeleteGroupRequest) (*emptypb.Empty, error)
- func (*Server) GetGroup(ctx context.Context, request *rpcpb.GetGroupRequest) (*rpcpb.AuthGroup, error)
- func (srv *Server) GetSubgraph(ctx context.Context, request *rpcpb.GetSubgraphRequest) (*rpcpb.Subgraph, error)
- func (srv *Server) ListGroups(ctx context.Context, _ *emptypb.Empty) (*rpcpb.ListGroupsResponse, error)
- func (srv *Server) RefreshPeriodically(ctx context.Context)
- func (srv *Server) UpdateGroup(ctx context.Context, request *rpcpb.UpdateGroupRequest) (*rpcpb.AuthGroup, error)
- func (srv *Server) Warmup(ctx context.Context)
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 (*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 (*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 ¶
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.