http_service

package
v0.0.0-...-9c9b480 Latest Latest
Warning

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

Go to latest
Published: Jul 25, 2022 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func HandleNon200

func HandleNon200(body io.ReadCloser) error

Types

type HTTPClient

type HTTPClient struct {
	// contains filtered or unexported fields
}

func (*HTTPClient) FetchFlag

func (c *HTTPClient) FetchFlag(url string, ctx of.EvaluationContext, p interface{}) (io.ReadCloser, int, error)

func (*HTTPClient) GetInstance

func (c *HTTPClient) GetInstance() http.Client

type HTTPService

type HTTPService struct {
	HTTPServiceConfiguration *HTTPServiceConfiguration
	Client                   IHTTPClient
}

func NewHTTPService

func NewHTTPService(opts ...HTTPServiceOption) *HTTPService

func (*HTTPService) ResolveBoolean

func (s *HTTPService) ResolveBoolean(flagKey string, context of.EvaluationContext, options ...service.IServiceOption) (*schemaV1.ResolveBooleanResponse, error)

func (*HTTPService) ResolveNumber

func (s *HTTPService) ResolveNumber(flagKey string, context of.EvaluationContext, options ...service.IServiceOption) (*schemaV1.ResolveNumberResponse, error)

func (*HTTPService) ResolveObject

func (s *HTTPService) ResolveObject(flagKey string, context of.EvaluationContext, options ...service.IServiceOption) (*schemaV1.ResolveObjectResponse, error)

func (*HTTPService) ResolveString

func (s *HTTPService) ResolveString(flagKey string, context of.EvaluationContext, options ...service.IServiceOption) (*schemaV1.ResolveStringResponse, error)

type HTTPServiceConfiguration

type HTTPServiceConfiguration struct {
	Port int32
	Host string
}

type HTTPServiceOption

type HTTPServiceOption func(*HTTPService)

func WithHost

func WithHost(host string) HTTPServiceOption

func WithPort

func WithPort(port int32) HTTPServiceOption

type IHTTPClient

type IHTTPClient interface {
	FetchFlag(url string, ctx of.EvaluationContext, p interface{}) (io.ReadCloser, int, error)
}

Directories

Path Synopsis
tests

Jump to

Keyboard shortcuts

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