server

package
v0.0.0-...-e534c60 Latest Latest
Warning

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

Go to latest
Published: Aug 12, 2024 License: MIT Imports: 20 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AddRequest

type AddRequest struct {
	Name            string `json:"name"`
	Info            string `json:"info"`
	InternalSeconds int    `json:"internal_seconds"`
}

func (AddRequest) Valid

func (req AddRequest) Valid() bool

type DelRequest

type DelRequest struct {
	ID string `json:"id"`
}

func (DelRequest) Valid

func (req DelRequest) Valid() bool

type Memo

type Memo struct {
	ID       string        `json:"id" yaml:"id"`
	Name     string        `json:"name" yaml:"name"`
	Info     string        `json:"info,omitempty" yaml:"info,omitempty"`
	Span     time.Duration `json:"span" yaml:"span"`
	Disabled bool          `json:"disabled,omitempty" yaml:"disabled,omitempty"`
}

type MemoAllItem

type MemoAllItem struct {
	ID       string `json:"id" yaml:"id"`
	Name     string `json:"name" yaml:"name"`
	Info     string `json:"info,omitempty" yaml:"info,omitempty"`
	Span     string `json:"span" yaml:"span"`
	Disabled bool   `json:"disabled,omitempty" yaml:"disabled,omitempty"`

	LastTouchAt          time.Time      `json:"last_touch_at,omitempty" yaml:"last_touch_at,omitempty"`
	LastSuccessTouchInfo *MemoTouchInfo `json:"last_success_touch_info,omitempty" yaml:"last_success_touch_info,omitempty"`
	LastFailTouchInfo    *MemoTouchInfo `json:"last_fail_touch_info,omitempty" yaml:"last_fail_touch_info,omitempty"`

	UntilExpired string `json:"until_expired,omitempty" yaml:"until_expired,omitempty"`
	Expired      bool   `json:"expired,omitempty" yaml:"expired,omitempty"`
}

type MemoData

type MemoData struct {
	Memos       map[string]*Memo
	MemoRecords map[string]*MemoRecord
}

type MemoRecord

type MemoRecord struct {
	ID                   string         `json:"id" yaml:"id"`
	LastTouchAt          time.Time      `json:"last_touch_at,omitempty" yaml:"last_touch_at,omitempty"`
	LastSuccessTouchInfo *MemoTouchInfo `json:"last_success_touch_info,omitempty" yaml:"last_success_touch_info,omitempty"`
	LastFailTouchInfo    *MemoTouchInfo `json:"last_fail_touch_info,omitempty" yaml:"last_fail_touch_info,omitempty"`
}

type MemoTouchInfo

type MemoTouchInfo struct {
	At   time.Time `json:"at" yaml:"at"`
	Info string    `json:"info,omitempty"`
}

type Server

type Server struct {
	// contains filtered or unexported fields
}

func NewServer

func NewServer(cfg *config.Config, logger l.Wrapper) *Server

func (*Server) Wait

func (s *Server) Wait()

type TouchRequest

type TouchRequest struct {
	ID       string `json:"id"`
	FailFlag bool   `json:"fail_flag,omitempty"`
	Info     string `json:"info,omitempty"`
}

func (TouchRequest) Valid

func (req TouchRequest) Valid() bool

Jump to

Keyboard shortcuts

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