Documentation
¶
Index ¶
- func GetAppTrait(resource *v2.Resource) (*v2.AppTrait, error)
- func GetGroupTrait(resource *v2.Resource) (*v2.GroupTrait, error)
- func GetProfileInt64Value(profile *structpb.Struct, k string) (int64, bool)
- func GetProfileStringValue(profile *structpb.Struct, k string) (string, bool)
- func GetRoleTrait(resource *v2.Resource) (*v2.RoleTrait, error)
- func GetUserTrait(resource *v2.Resource) (*v2.UserTrait, error)
- func NewAppResource(name string, resourceType *v2.ResourceType, parentResourceID *v2.ResourceId, ...) (*v2.Resource, error)
- func NewAppTrait(helpURL string, profile map[string]interface{}) (*v2.AppTrait, error)
- func NewAssignmentEntitlement(resource *v2.Resource, name string, grantableTo ...*v2.ResourceType) *v2.Entitlement
- func NewConnectorRunner(ctx context.Context, c types.ConnectorServer, dbPath string, opts ...Option) (*connectorRunner, error)
- func NewEmptyConnector() (*emptyConnector, error)
- func NewEntitlementID(resource *v2.Resource, permission string) string
- func NewGrant(resource *v2.Resource, entitlementName string, principal *v2.ResourceId) *v2.Grant
- func NewGroupResource(name string, resourceType *v2.ResourceType, parentResourceID *v2.ResourceId, ...) (*v2.Resource, error)
- func NewGroupTrait(profile map[string]interface{}) (*v2.GroupTrait, error)
- func NewPermissionEntitlement(resource *v2.Resource, name string, grantableTo ...*v2.ResourceType) *v2.Entitlement
- func NewResource(name string, resourceType *v2.ResourceType, parentResourceID *v2.ResourceId, ...) (*v2.Resource, error)
- func NewResourceID(resourceType *v2.ResourceType, objectID interface{}) (*v2.ResourceId, error)
- func NewRoleResource(name string, resourceType *v2.ResourceType, parentResourceID *v2.ResourceId, ...) (*v2.Resource, error)
- func NewRoleTrait(profile map[string]interface{}) (*v2.RoleTrait, error)
- func NewUserResource(name string, resourceType *v2.ResourceType, parentResourceID *v2.ResourceId, ...) (*v2.Resource, error)
- func NewUserTrait(primaryEmail string, status v2.UserTrait_Status_Status, ...) (*v2.UserTrait, error)
- type Option
- func WithExternalLimiter(address string, opts map[string]string) Option
- func WithFixedMemoryLimiter(rate int64, period time.Duration) Option
- func WithRateLimitDescriptor(entry *ratelimitV1.RateLimitDescriptors_Entry) Option
- func WithRateLimiterConfig(cfg *ratelimitV1.RateLimiterConfig) Option
- func WithSlidingMemoryLimiter(usePercent int64) Option
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetAppTrait ¶ added in v0.0.12
GetAppTrait attempts to return the AppTrait instance on a resource.
func GetGroupTrait ¶ added in v0.0.12
func GetGroupTrait(resource *v2.Resource) (*v2.GroupTrait, error)
GetGroupTrait attempts to return the GroupTrait instance on a resource.
func GetProfileInt64Value ¶ added in v0.0.12
GetProfileInt64Value returns an int64 and true if the value is found.
func GetProfileStringValue ¶ added in v0.0.12
GetProfileStringValue returns a string and true if the value is found.
func GetRoleTrait ¶ added in v0.0.12
GetRoleTrait attempts to return the RoleTrait instance on a resource.
func GetUserTrait ¶ added in v0.0.12
GetUserTrait attempts to return the UserTrait instance on a resource.
func NewAppResource ¶ added in v0.0.11
func NewAppResource( name string, resourceType *v2.ResourceType, parentResourceID *v2.ResourceId, objectID interface{}, helpURL string, profile map[string]interface{}, ) (*v2.Resource, error)
NewAppResource returns a new resource instance with a configured app trait. The trait is configured with the provided helpURL and profile.
func NewAppTrait ¶
NewAppTrait creates a new `AppTrait` with the given help URL, and profile.
func NewAssignmentEntitlement ¶ added in v0.0.11
func NewAssignmentEntitlement(resource *v2.Resource, name string, grantableTo ...*v2.ResourceType) *v2.Entitlement
func NewConnectorRunner ¶
func NewConnectorRunner(ctx context.Context, c types.ConnectorServer, dbPath string, opts ...Option) (*connectorRunner, error)
NewConnectorRunner creates a new connector runner.
func NewEmptyConnector ¶
func NewEmptyConnector() (*emptyConnector, error)
NewEmptyConnector returns a new emptyConnector.
func NewEntitlementID ¶ added in v0.0.7
func NewGrant ¶ added in v0.0.11
NewGrant returns a new grant for the given entitlement on the resource for the provided principal resource ID.
func NewGroupResource ¶ added in v0.0.11
func NewGroupResource( name string, resourceType *v2.ResourceType, parentResourceID *v2.ResourceId, objectID interface{}, profile map[string]interface{}, ) (*v2.Resource, error)
NewGroupResource returns a new resource instance with a configured group trait. The trait is configured with the provided profile.
func NewGroupTrait ¶
func NewGroupTrait(profile map[string]interface{}) (*v2.GroupTrait, error)
NewGroupTrait creates a new `GroupTrait` with the provided profile.
func NewPermissionEntitlement ¶ added in v0.0.11
func NewPermissionEntitlement(resource *v2.Resource, name string, grantableTo ...*v2.ResourceType) *v2.Entitlement
func NewResource ¶ added in v0.0.11
func NewResource(name string, resourceType *v2.ResourceType, parentResourceID *v2.ResourceId, objectID interface{}) (*v2.Resource, error)
NewResource returns a new resource instance with no traits.
func NewResourceID ¶ added in v0.0.7
func NewResourceID(resourceType *v2.ResourceType, objectID interface{}) (*v2.ResourceId, error)
NewResourceID returns a new resource ID given a resource type parent ID, and arbitrary object ID.
func NewRoleResource ¶ added in v0.0.11
func NewRoleResource( name string, resourceType *v2.ResourceType, parentResourceID *v2.ResourceId, objectID interface{}, profile map[string]interface{}, ) (*v2.Resource, error)
NewRoleResource returns a new resource instance with a configured role trait. The trait is configured with the provided profile.
func NewRoleTrait ¶ added in v0.0.8
NewRoleTrait creates a new `RoleTrait` with the given profile.
func NewUserResource ¶ added in v0.0.11
func NewUserResource( name string, resourceType *v2.ResourceType, parentResourceID *v2.ResourceId, objectID interface{}, primaryEmail string, profile map[string]interface{}, ) (*v2.Resource, error)
NewUserResource returns a new resource instance with a configured user trait. The trait is configured with the provided email address and profile and status set to enabled.
func NewUserTrait ¶
func NewUserTrait(primaryEmail string, status v2.UserTrait_Status_Status, profile map[string]interface{}) (*v2.UserTrait, error)
NewUserTrait creates a new `UserTrait` with the given primary email, status, and profile.
Types ¶
type Option ¶
func WithExternalLimiter ¶
WithExternalLimiter configures the connector to use an external rate limiter. The `opts` map is injected into the environment in order for the service to be configured.
func WithFixedMemoryLimiter ¶
WithFixedMemoryLimiter configures to use a fixed-memory limiter. `rate` is a number on how many times it should be in the given period executed. `period` represents the elapsed time between two instants as an int64 nanosecond count.
func WithRateLimitDescriptor ¶
func WithRateLimitDescriptor(entry *ratelimitV1.RateLimitDescriptors_Entry) Option
WithRateLimitDescriptor takes a rate limit descriptor and adds it to the list of rate limit descriptors.
func WithRateLimiterConfig ¶
func WithRateLimiterConfig(cfg *ratelimitV1.RateLimiterConfig) Option
WithRateLimiterConfig sets the RateLimiterConfig for a runner.
func WithSlidingMemoryLimiter ¶
WithSlidingMemoryLimiter configures the connector to use an in-memory rate limiter that adjusts to maintain fairness based on request headers. `usePercent` is value between 0 and 100.