Documentation ¶
Index ¶
- Constants
- type Datastore
- type FilesystemDatastore
- func (d *FilesystemDatastore) Add(okr *OKR) error
- func (d *FilesystemDatastore) Delete(id string) error
- func (d *FilesystemDatastore) Get(id string) (*OKR, error)
- func (d *FilesystemDatastore) GetAll() ([]*OKR, error)
- func (d *FilesystemDatastore) GetByQuarter(quarter string) ([]*OKR, error)
- func (d *FilesystemDatastore) Initialize() error
- func (d *FilesystemDatastore) Update(updatedOKR *OKR) error
- type InMemoryDatastore
- func (d *InMemoryDatastore) Add(newOKR *OKR) error
- func (d *InMemoryDatastore) Delete(id string) error
- func (d *InMemoryDatastore) Get(id string) (*OKR, error)
- func (d *InMemoryDatastore) GetAll() ([]*OKR, error)
- func (d *InMemoryDatastore) GetByQuarter(quarter string) ([]*OKR, error)
- func (d *InMemoryDatastore) Update(updatedOKR *OKR) error
- type OKR
- type Server
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 ¶
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) 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) 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 (*OKR) UpdateMetrics ¶
func (okr *OKR) UpdateMetrics()
Click to show internal directories.
Click to hide internal directories.