impl

package
v0.0.0-...-7d7216e Latest Latest
Warning

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

Go to latest
Published: May 2, 2024 License: Apache-2.0, Apache-2.0 Imports: 18 Imported by: 0

Documentation

Overview

Package impl is the implementation of the Firmware Transparency map server.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Main

func Main(ctx context.Context, opts MapServerOpts) error

Main brings up an http server according to the given options.

Types

type MapReader

type MapReader interface {
	// LatestRevision gets the metadata for the last completed write.
	LatestRevision() (rev int, logroot types.LogRootV1, count int64, err error)

	// Tile gets the tile at the given path in the given revision of the map.
	Tile(revision int, path []byte) (*batchmap.Tile, error)

	// Aggregation gets the aggregation for the firmware at the given log index.
	Aggregation(revision int, fwLogIndex uint64) (api.AggregatedFirmware, error)
}

MapReader is an interface that allows a map to be read from storage.

type MapServerOpts

type MapServerOpts struct {
	ListenAddr string
	MapDBAddr  string
}

MapServerOpts encapsulates options for running an FT map server.

type MockMapReader

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

MockMapReader is a mock of MapReader interface.

func NewMockMapReader

func NewMockMapReader(ctrl *gomock.Controller) *MockMapReader

NewMockMapReader creates a new mock instance.

func (*MockMapReader) Aggregation

func (m *MockMapReader) Aggregation(arg0 int, arg1 uint64) (api.AggregatedFirmware, error)

Aggregation mocks base method.

func (*MockMapReader) EXPECT

EXPECT returns an object that allows the caller to indicate expected use.

func (*MockMapReader) LatestRevision

func (m *MockMapReader) LatestRevision() (int, types.LogRootV1, int64, error)

LatestRevision mocks base method.

func (*MockMapReader) Tile

func (m *MockMapReader) Tile(arg0 int, arg1 []byte) (*batchmap.Tile, error)

Tile mocks base method.

type MockMapReaderMockRecorder

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

MockMapReaderMockRecorder is the mock recorder for MockMapReader.

func (*MockMapReaderMockRecorder) Aggregation

func (mr *MockMapReaderMockRecorder) Aggregation(arg0, arg1 interface{}) *gomock.Call

Aggregation indicates an expected call of Aggregation.

func (*MockMapReaderMockRecorder) LatestRevision

func (mr *MockMapReaderMockRecorder) LatestRevision() *gomock.Call

LatestRevision indicates an expected call of LatestRevision.

func (*MockMapReaderMockRecorder) Tile

func (mr *MockMapReaderMockRecorder) Tile(arg0, arg1 interface{}) *gomock.Call

Tile indicates an expected call of Tile.

type Server

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

Server is the core state & handler implementation of the FT personality.

func (*Server) RegisterHandlers

func (s *Server) RegisterHandlers(r *mux.Router)

RegisterHandlers registers HTTP handlers for the endpoints.

Jump to

Keyboard shortcuts

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