cluster

package
v0.2.12 Latest Latest
Warning

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

Go to latest
Published: Jun 21, 2023 License: MIT Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func SetupFakeServerBasicAuth

func SetupFakeServerBasicAuth(t *testing.T, status int, path string, body string, isJSON bool, called func()) *httptest.Server

func SetupFakeServerNoAuth

func SetupFakeServerNoAuth(t *testing.T, status int, path string, body string, isJSON bool, called func()) *httptest.Server

Types

type HttpClient

type HttpClient interface {
	Do(req *http.Request) (*http.Response, error)
}

type MockBody

type MockBody struct {
	mock.Mock
	Reader io.Reader
}

func (*MockBody) Close

func (b *MockBody) Close() error

func (*MockBody) Read

func (b *MockBody) Read(p []byte) (n int, err error)

type MockClient

type MockClient struct {
	mock.Mock
}

func (*MockClient) Do

func (c *MockClient) Do(r *http.Request) (*http.Response, error)

type MockService

type MockService struct {
	mock.Mock
}

func (*MockService) Check

func (m *MockService) Check() error

func (*MockService) Description

func (m *MockService) Description() string

func (*MockService) Name

func (m *MockService) Name() string

func (*MockService) ServiceName

func (m *MockService) ServiceName() string

func (*MockService) String

func (m *MockService) String() string

type MockWatcher

type MockWatcher struct {
	mock.Mock
	// contains filtered or unexported fields
}

func (*MockWatcher) Read

func (m *MockWatcher) Read(key string) (string, error)

func (*MockWatcher) Watch

func (m *MockWatcher) Watch(ctx context.Context, key string, callback func(val string))

type Service

type Service interface {
	fmt.Stringer
	ServiceName() string
	Name() string
	Check() error
}

Service is a generic service of an UPP cluster that implements a standard FT Good-To-Go endpoint.

func NewService

func NewService(serviceName string, urlString string, checkHealthchecks bool) (Service, error)

NewService returns a new instance of a UPP cluster service which checks either the /__gtg or the /__health endpoints

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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