sdk

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Nov 15, 2022 License: Apache-2.0 Imports: 13 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewAppTrait

func NewAppTrait(icon *v2.AssetRef, logo *v2.AssetRef, helpURL string, profile map[string]interface{}) (*v2.AppTrait, error)

NewAppTrait creates a new `AppTrait` with the given icon, logo, help URL, and profile.

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 NewGroupTrait

func NewGroupTrait(assetRef *v2.AssetRef, profile map[string]interface{}) (*v2.GroupTrait, error)

NewGroupTrait creates a new `GroupTrait` with the fiven icon, and profile.

func NewUserTrait

func NewUserTrait(primaryEmail string, status v2.UserTrait_Status_Status, assetRef *v2.AssetRef, profile map[string]interface{}) (*v2.UserTrait, error)

NewUserTrait creates a new `UserTrait` with the given primary email, status, asset reference, and profile.

Types

type Option

type Option func(ctx context.Context, cfg *runnerConfig) error

func WithExternalLimiter

func WithExternalLimiter(address string, opts map[string]string) Option

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

func WithFixedMemoryLimiter(rate int64, period time.Duration) Option

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

func WithSlidingMemoryLimiter(usePercent int64) Option

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.

Jump to

Keyboard shortcuts

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