testserver

package
v1.7.3 Latest Latest
Warning

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

Go to latest
Published: Jul 16, 2024 License: GPL-3.0 Imports: 29 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type FakeNode

type FakeNode struct {
	NodePort int
	InitDone chan struct{}
	// contains filtered or unexported fields
}

FakeNode simulate spacemesh node.

func CreateFakeSMNode

func CreateFakeSMNode(startTime time.Time, seedGen *testseed.SeedGenerator, seedConf *testseed.TestServerSeed) (*FakeNode, error)

CreateFakeSMNode create a fake spacemesh node.

func (*FakeNode) Start

func (f *FakeNode) Start() error

Start register fake services and start stream generated data.

func (*FakeNode) Stop

func (f *FakeNode) Stop()

Stop stop fake node.

type FakePrivateNode added in v0.0.22

type FakePrivateNode struct {
	NodePort int
	InitDone chan struct{}
	// contains filtered or unexported fields
}

func CreateFakeSMPrivateNode added in v0.0.22

func CreateFakeSMPrivateNode(startTime time.Time, seedGen *testseed.SeedGenerator, seedConf *testseed.TestServerSeed) (*FakePrivateNode, error)

func (*FakePrivateNode) Start added in v0.0.22

func (f *FakePrivateNode) Start() error

Start register fake services and start stream generated data.

func (*FakePrivateNode) Stop added in v0.0.22

func (f *FakePrivateNode) Stop()

Stop stop fake node.

type TestAPIService

type TestAPIService struct {
	Storage *storage.Storage
	// contains filtered or unexported fields
}

TestAPIService wrapper over fake api service.

func StartTestAPIServiceV2

func StartTestAPIServiceV2(db *storage.Storage, dbReader *storagereader.Reader) (*TestAPIService, error)

StartTestAPIServiceV2 start test api service with refacored router.

func (*TestAPIService) Get

func (tx *TestAPIService) Get(t *testing.T, path string) *testutils.TestResponse

Get allow to execute GET request to the fake server.

func (*TestAPIService) GetReadWS

func (tx *TestAPIService) GetReadWS(t *testing.T, path string) <-chan []byte

GetReadWS allow to execute WS read-only request to the fake server.

Jump to

Keyboard shortcuts

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