internal

package
v0.0.0-...-9b4c053 Latest Latest
Warning

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

Go to latest
Published: Apr 24, 2024 License: Apache-2.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DatastoreTypeFilesystem = "fs"
	DatastoreTypeMemory     = "memory"
)
View Source
const (
	OKRTypeBoolean    = "boolean"
	OKRTypeNumber     = "number"
	OKRTypePercentage = "percent"
)
View Source
const DefaultPort = 8080

Variables

This section is empty.

Functions

This section is empty.

Types

type Datastore

type Datastore interface {
	Add(*OKR) error
	Update(*OKR) error
	Delete(id string) error
	Get(id string) (*OKR, error)
	GetAll() ([]*OKR, error)
	GetByQuarter(quarter string) ([]*OKR, error)
}

func InitializeDatastore

func InitializeDatastore() (Datastore, error)

type FilesystemDatastore

type FilesystemDatastore struct {
	Path   string
	Format string
	// contains filtered or unexported fields
}

func (*FilesystemDatastore) Add

func (d *FilesystemDatastore) Add(okr *OKR) error

func (*FilesystemDatastore) Delete

func (d *FilesystemDatastore) Delete(id string) error

func (*FilesystemDatastore) Get

func (d *FilesystemDatastore) Get(id string) (*OKR, error)

func (*FilesystemDatastore) GetAll

func (d *FilesystemDatastore) GetAll() ([]*OKR, error)

func (*FilesystemDatastore) GetByQuarter

func (d *FilesystemDatastore) GetByQuarter(quarter string) ([]*OKR, error)

func (*FilesystemDatastore) Initialize

func (d *FilesystemDatastore) Initialize() error

func (*FilesystemDatastore) Update

func (d *FilesystemDatastore) Update(updatedOKR *OKR) error

type InMemoryDatastore

type InMemoryDatastore struct {
	OKRs []*OKR
}

func (*InMemoryDatastore) Add

func (d *InMemoryDatastore) Add(newOKR *OKR) error

func (*InMemoryDatastore) Delete

func (d *InMemoryDatastore) Delete(id string) error

func (*InMemoryDatastore) Get

func (d *InMemoryDatastore) Get(id string) (*OKR, error)

func (*InMemoryDatastore) GetAll

func (d *InMemoryDatastore) GetAll() ([]*OKR, error)

func (*InMemoryDatastore) GetByQuarter

func (d *InMemoryDatastore) GetByQuarter(quarter string) ([]*OKR, error)

func (*InMemoryDatastore) Update

func (d *InMemoryDatastore) Update(updatedOKR *OKR) error

type OKR

type OKR struct {
	ID          string  `json:"id" yaml:"id"`
	Quarter     string  `json:"quarter" yaml:"quarter"`
	Category    string  `json:"category" yaml:"category"`
	ValueType   string  `json:"type" yaml:"type"`
	Description string  `json:"description" yaml:"description"`
	Goal        float64 `json:"goal" yaml:"goal"`
	Progress    float64 `json:"progress" yaml:"progress"`
	// contains filtered or unexported fields
}

func CreateOKR

func CreateOKR(quarter, category, valueType, description string, goal float64) *OKR

func (*OKR) Set

func (okr *OKR) Set(other *OKR)

func (*OKR) UpdateMetrics

func (okr *OKR) UpdateMetrics()

type Server

type Server struct {
	Port      int
	Datastore Datastore
}

func (*Server) Start

func (s *Server) Start() error

Jump to

Keyboard shortcuts

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