adapters

package
v1.9.1 Latest Latest
Warning

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

Go to latest
Published: Jan 2, 2025 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Middleware

func Middleware(client ldapi.APIClient, streamingUrl string) func(handler http.Handler) http.Handler

Middleware puts adapters on to the context for consumption by other things

func WithApi

func WithApi(ctx context.Context, s Api) context.Context

func WithApiAndSdk added in v1.9.0

func WithApiAndSdk(ctx context.Context, client ldapi.APIClient, streamingUrl string) context.Context

func WithSdk

func WithSdk(ctx context.Context, s Sdk) context.Context

Types

type Api

type Api interface {
	GetSdkKey(ctx context.Context, projectKey, environmentKey string) (string, error)
	GetAllFlags(ctx context.Context, projectKey string) ([]ldapi.FeatureFlag, error)
	GetProjectEnvironments(ctx context.Context, projectKey string, query string, limit *int) ([]ldapi.Environment, error)
}

func GetApi

func GetApi(ctx context.Context) Api

func NewApi

func NewApi(client ldapi.APIClient) Api

type Sdk

type Sdk interface {
	GetAllFlagsState(ctx context.Context, ldContext ldcontext.Context, sdkKey string) (flagstate.AllFlags, error)
}

func GetSdk

func GetSdk(ctx context.Context) Sdk

Directories

Path Synopsis
Package internal is a generated GoMock package.
Package internal is a generated GoMock package.
Package mocks is a generated GoMock package.
Package mocks is a generated GoMock package.

Jump to

Keyboard shortcuts

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