projects

package
v0.0.0-...-dbfda16 Latest Latest
Warning

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

Go to latest
Published: Sep 22, 2022 License: BSD-3-Clause Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Message

type Message struct {
	Type        string `json:"type"` //indicates type of instruction
	ProjectID   string `json:"projectID"`
	Workspace   string `json:"workspace"`
	ThreatModel string `json:"threatModel"`
	VisualModel string `json:"visualModel"`
	HasError    bool   `json:"hasError"`
	Error       string `json:"error"`
}

type Model

type Model struct {
	ThreatModel     string `json:"threatModel"`
	VisualModel     string `json:"visualModel"`
	VisualIsUpdated bool   `json:"visualIsUpdated"`
	ThreatIsUpdated bool   `json:"threatIsUpdated"`
}

type Project

type Project struct {
	ID string `json:"id" yaml:"id"`
	ProjectDescription
}

type ProjectDescription

type ProjectDescription struct {
	Name         string            `json:"name" yaml:"name"`
	Workspace    string            `json:"workspace"`
	Description  string            `yaml:"description,omitempty" json:"description,omitempty"`
	Owner        string            `yaml:"owner" json:"owner"`
	OwnerContact string            `yaml:"ownerContact" json:"ownerContact"`
	Attributes   map[string]string `yaml:"attributes,omitempty" json:"attributes,omitempty"`
}

type ProjectManager

type ProjectManager interface {
	GetWorkspaces() (*Workspace, error)
	SaveWorkspaces(*Workspace) error
	GetProject(id string) (*Project, error)
	ListProjects() ([]*Project, error)
	DeleteProject(id string) error
	CreateProject(projectDescription ProjectDescription) (*Project, error)
	UpdateProject(projectID string, projectDescription ProjectDescription,
		wsSummariser WorkspaceSummariser) (*Project, error)
	UpdateModel(projectID string, msg *Message) (*Message, error)
	GetModel(projectID string) (*Message, error)
	GetProjectLocation(projID string) string
	//ZeroTrust base directory
	GetBaseDir() string
}

func NewDBProjectManager

func NewDBProjectManager(ztBaseDir string) (ProjectManager, error)

type ProjectModel

type ProjectModel struct {
	ThreatModel otm.OpenThreatModel `json:"threatModel" yaml:"threatModel"`
	VisualModel string              `json:"visualModel"`
}

type ProjectSlice

type ProjectSlice []*Project

func (ProjectSlice) Len

func (t ProjectSlice) Len() int

func (ProjectSlice) Less

func (t ProjectSlice) Less(i, j int) bool

func (ProjectSlice) Swap

func (t ProjectSlice) Swap(i, j int)

type Workspace

type Workspace struct {
	Details map[string]*WorkspaceDetail `json:"details" yaml:"details"`
}

func SimpleWorkspaceSummariser

func SimpleWorkspaceSummariser(pm ProjectManager, workspacesToUpdate []string) (*Workspace, error)

func (*Workspace) RemoveProject

func (ws *Workspace) RemoveProject(ps *Project, pm ProjectManager) error

type WorkspaceDetail

type WorkspaceDetail struct {
	Projects []*Project `json:"projects" yaml:"projects"`
}

type WorkspaceSummariser

type WorkspaceSummariser func(pm ProjectManager, workspacesToUpdate []string) (*Workspace, error)

Jump to

Keyboard shortcuts

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