Documentation ¶
Overview ¶
Package groups contains Groups server implementation.
Index ¶
- type AuthGroupJSON
- type AuthGroupsProvider
- type AuthGroupsSnapshot
- type CachingGroupsProvider
- type ListingJSON
- 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 (srv *Server) GetExpandedGroup(ctx context.Context, request *rpcpb.GetGroupRequest) (*rpcpb.AuthGroup, error)
- func (*Server) GetGroup(ctx context.Context, request *rpcpb.GetGroupRequest) (*rpcpb.AuthGroup, error)
- func (srv *Server) GetLegacyAuthGroup(ctx *router.Context) error
- func (srv *Server) GetLegacyListing(ctx *router.Context) 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 AuthGroupJSON ¶
type AuthGroupJSON struct { Name string `json:"name"` Description string `json:"description"` Owners string `json:"owners"` Members []string `json:"members"` Globs []string `json:"globs"` Nested []string `json:"nested"` CreatedBy string `json:"created_by"` CreatedTS int64 `json:"created_ts"` ModifiedBy string `json:"modified_by"` ModifiedTS int64 `json:"modified_ts"` CallerCanModify bool `json:"caller_can_modify"` }
AuthGroupJSON is the underlying data structure returned by the legacy method of getting an AuthGroup.
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 ListingJSON ¶
type ListingJSON struct { Members []listingPrincipal `json:"members"` Globs []listingPrincipal `json:"globs"` Nested []listingPrincipal `json:"nested"` }
ListingJSON is the underlying data structure returned by the legacy method of getting the expanded listing of an AuthGroup.
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) GetExpandedGroup ¶
func (srv *Server) GetExpandedGroup(ctx context.Context, request *rpcpb.GetGroupRequest) (*rpcpb.AuthGroup, error)
GetExpandedGroup 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.
func (*Server) GetGroup ¶
func (*Server) GetGroup(ctx context.Context, request *rpcpb.GetGroupRequest) (*rpcpb.AuthGroup, error)
GetGroup implements the corresponding RPC method.
func (*Server) GetLegacyAuthGroup ¶
GetLegacyAuthGroup serves the legacy REST API GET request for an AuthGroup.
func (*Server) GetLegacyListing ¶
GetLegacyListing serves the legacy REST API GET request for the listing of an AuthGroup.
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.