server

package
v1.6.0 Latest Latest
Warning

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

Go to latest
Published: Aug 22, 2025 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Rest

type Rest struct {
	Listen  string
	Version string
	Status  Status
}

Rest implement http api invoking remote execution for requested tasks

func (*Rest) Run

func (s *Rest) Run(ctx context.Context) error

Run starts http server and closes on context cancellation

type Status

type Status interface {
	Get() (*status.Info, error)
}

Status is used to get status info of the server

type StatusMock

type StatusMock struct {
	// GetFunc mocks the Get method.
	GetFunc func() (*status.Info, error)
	// contains filtered or unexported fields
}

StatusMock is a mock implementation of Status.

func TestSomethingThatUsesStatus(t *testing.T) {

	// make and configure a mocked Status
	mockedStatus := &StatusMock{
		GetFunc: func() (*status.Info, error) {
			panic("mock out the Get method")
		},
	}

	// use mockedStatus in code that requires Status
	// and then make assertions.

}

func (*StatusMock) Get

func (mock *StatusMock) Get() (*status.Info, error)

Get calls GetFunc.

func (*StatusMock) GetCalls

func (mock *StatusMock) GetCalls() []struct {
}

GetCalls gets all the calls that were made to Get. Check the length with:

len(mockedStatus.GetCalls())

Jump to

Keyboard shortcuts

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