services

package
v0.0.0-...-310c153 Latest Latest
Warning

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

Go to latest
Published: Mar 20, 2024 License: MIT Imports: 15 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ClientHost  = "Client"
	SmockerHost = "Smocker"
)

Variables

View Source
var (
	SessionNotFound = fmt.Errorf("session not found")
	MockNotFound    = fmt.Errorf("mock not found")
)

Functions

This section is empty.

Types

type Graph

type Graph interface {
	Generate(cfg types.GraphConfig, session *types.Session) types.GraphHistory
}

func NewGraph

func NewGraph() Graph

type Mocks

type Mocks interface {
	AddMock(sessionID string, mock *types.Mock) (*types.Mock, error)
	GetMocks(sessionID string) (types.Mocks, error)
	GetMockByID(sessionID, id string) (*types.Mock, error)
	LockMocks(ids []string) types.Mocks
	UnlockMocks(ids []string) types.Mocks
	AddHistoryEntry(sessionID string, entry *types.Entry) (*types.Entry, error)
	GetHistory(sessionID string) (types.History, error)
	GetHistoryByPath(sessionID, filterPath string) (types.History, error)
	NewSession(name string) *types.Session
	UpdateSession(id, name string) (*types.Session, error)
	GetLastSession() *types.Session
	GetSessionByID(id string) (*types.Session, error)
	GetSessions() types.Sessions
	SetSessions(sessions types.Sessions)
	Reset(force bool)
}

func NewMocks

func NewMocks(sessions types.Sessions, historyRetention int, persistence Persistence) Mocks

type Persistence

type Persistence interface {
	LoadSessions() (types.Sessions, error)
	StoreMocks(sessionID string, mocks types.Mocks)
	StoreHistory(sessionID string, history types.History)
	StoreSession(summary []types.SessionSummary, session *types.Session)
	StoreSessions(types.Sessions)
}

func NewPersistence

func NewPersistence(persistenceDirectory string) Persistence

Jump to

Keyboard shortcuts

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