proj

package
v0.7.0 Latest Latest
Warning

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

Go to latest
Published: Mar 29, 2022 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrProjectNotFound = errors.New("proj: project not found")
	ErrNoProject       = errors.New("proj: no open project")
	ErrNoSettings      = errors.New("proj: settings not found")
	ErrInvalidName     = errors.New("proj: invalid name, must be alphanumeric or whitespace chars")
)

Functions

This section is empty.

Types

type Config added in v0.4.0

type Config struct {
	Repository       Repository
	InterceptService *intercept.Service
	ReqLogService    reqlog.Service
	SenderService    sender.Service
	Scope            *scope.Scope
}

type Project

type Project struct {
	ID       ulid.ULID
	Name     string
	Settings Settings
	// contains filtered or unexported fields
}

type Repository

type Repository interface {
	FindProjectByID(ctx context.Context, id ulid.ULID) (Project, error)
	UpsertProject(ctx context.Context, project Project) error
	DeleteProject(ctx context.Context, id ulid.ULID) error
	Projects(ctx context.Context) ([]Project, error)
	Close() error
}

type Service

type Service interface {
	CreateProject(ctx context.Context, name string) (Project, error)
	OpenProject(ctx context.Context, projectID ulid.ULID) (Project, error)
	CloseProject() error
	DeleteProject(ctx context.Context, projectID ulid.ULID) error
	ActiveProject(ctx context.Context) (Project, error)
	IsProjectActive(projectID ulid.ULID) bool
	Projects(ctx context.Context) ([]Project, error)
	Scope() *scope.Scope
	SetScopeRules(ctx context.Context, rules []scope.Rule) error
	SetRequestLogFindFilter(ctx context.Context, filter reqlog.FindRequestsFilter) error
	SetSenderRequestFindFilter(ctx context.Context, filter sender.FindRequestsFilter) error
	UpdateInterceptSettings(ctx context.Context, settings intercept.Settings) error
}

Service is used for managing projects.

func NewService

func NewService(cfg Config) (Service, error)

NewService returns a new Service.

type Settings added in v0.4.0

type Settings struct {
	// Request log settings
	ReqLogBypassOutOfScope bool
	ReqLogOnlyFindInScope  bool
	ReqLogSearchExpr       search.Expression

	// Intercept settings
	InterceptRequests       bool
	InterceptResponses      bool
	InterceptRequestFilter  search.Expression
	InterceptResponseFilter search.Expression

	// Sender settings
	SenderOnlyFindInScope bool
	SenderSearchExpr      search.Expression

	// Scope settings
	ScopeRules []scope.Rule
}

Jump to

Keyboard shortcuts

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