http

package
v0.0.30 Latest Latest
Warning

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

Go to latest
Published: Nov 30, 2025 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewHappeningService added in v0.0.15

func NewHappeningService(client *Client) storage.HappeningService

func NewLogEntryService

func NewLogEntryService(client *Client) storage.LogEntryService

func NewLogNoteService

func NewLogNoteService(client *Client) storage.LogNoteService

func NewStateRecordingService added in v0.0.16

func NewStateRecordingService(client *Client) storage.StateRecordingService

Types

type Client

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

func NewClient

func NewClient(serverAddr string, serverAuthToken string) *Client

type HappeningHttpService added in v0.0.15

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

HappeningHttpService implements storage.HappeningService

func (*HappeningHttpService) Add added in v0.0.15

func (*HappeningHttpService) Delete added in v0.0.15

func (s *HappeningHttpService) Delete(ctx context.Context, id int64) error

func (*HappeningHttpService) List added in v0.0.15

func (*HappeningHttpService) Update added in v0.0.15

type LearningMaterialsHttpService added in v0.0.25

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

LearningMaterialsHttpService implements learning materials service

func NewLearningMaterialsService added in v0.0.25

func NewLearningMaterialsService(client *Client) *LearningMaterialsHttpService

func (*LearningMaterialsHttpService) GetMaterialContent added in v0.0.25

func (s *LearningMaterialsHttpService) GetMaterialContent(ctx context.Context, id int64, offset int, limit int) (*MaterialContentResponse, error)

func (*LearningMaterialsHttpService) GetReadingPosition added in v0.0.26

func (s *LearningMaterialsHttpService) GetReadingPosition(ctx context.Context, materialID int64) (int64, error)

GetReadingPosition retrieves the saved reading position for a material

func (*LearningMaterialsHttpService) ListMaterials added in v0.0.25

func (s *LearningMaterialsHttpService) ListMaterials(ctx context.Context, offset int, limit int) ([]*models.LearningMaterial, int64, error)

func (*LearningMaterialsHttpService) UpdateReadingPosition added in v0.0.26

func (s *LearningMaterialsHttpService) UpdateReadingPosition(ctx context.Context, materialID int64, offset int64) error

UpdateReadingPosition saves the reading offset for a material

type LogEntryHttpService

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

LogEntryHttpService implements storage.LogEntryService

func (*LogEntryHttpService) Add

func (s *LogEntryHttpService) Add(entry models.LogEntry) (int64, error)

func (*LogEntryHttpService) Delete

func (s *LogEntryHttpService) Delete(id int64) error

func (*LogEntryHttpService) GetTree added in v0.0.12

func (s *LogEntryHttpService) GetTree(ctx context.Context, id int64, includeHistory bool) ([]models.LogEntry, error)

func (*LogEntryHttpService) List

func (*LogEntryHttpService) Move

func (s *LogEntryHttpService) Move(id int64, newParentID int64) error

func (*LogEntryHttpService) Update

func (s *LogEntryHttpService) Update(id int64, update models.LogEntryOptional) error

type LogNoteHttpService

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

LogNoteHttpService implements storage.LogNoteService

func (*LogNoteHttpService) Add

func (s *LogNoteHttpService) Add(entryID int64, note models.Note) (int64, error)

func (*LogNoteHttpService) Delete

func (s *LogNoteHttpService) Delete(entryID int64, noteID int64) error

func (*LogNoteHttpService) List

func (s *LogNoteHttpService) List(entryID int64, options storage.LogNoteListOptions) ([]models.Note, int64, error)

func (*LogNoteHttpService) ListForEntries

func (s *LogNoteHttpService) ListForEntries(entryIDs []int64) (map[int64][]models.Note, error)

func (*LogNoteHttpService) Update

func (s *LogNoteHttpService) Update(entryID int64, noteID int64, update models.NoteOptional) error

type MaterialContentResponse added in v0.0.25

type MaterialContentResponse struct {
	Content    string `json:"content"`
	TotalBytes int    `json:"total_bytes"`
	HasMore    bool   `json:"has_more"`
	LastOffset int64  `json:"last_offset"`
}

type OptionalNumber added in v0.0.15

type OptionalNumber string

OptionalNumber represents an optional number that can be null, empty string, or a number

func (OptionalNumber) Int64 added in v0.0.15

func (c OptionalNumber) Int64() (int64, error)

func (*OptionalNumber) UnmarshalJSON added in v0.0.15

func (c *OptionalNumber) UnmarshalJSON(data []byte) error

type Request added in v0.0.15

type Request struct {
	*RequestBase
	TodoID      OptionalNumber   `json:"todoID"`
	ThreadForID OptionalNumber   `json:"threadForID"`
	TodoStatus  TodoRecordStatus `json:"todoStatus"`
}

Request replicates ListHappeningReq from lifelog

type RequestBase added in v0.0.15

type RequestBase struct {
	Search string  `json:"search"`
	ID     int64   `json:"id"`
	IDs    []int64 `json:"ids"`

	ContextBefore int `json:"contextBefore"`
	ContextAhead  int `json:"contextAhead"`

	IncludeAutogen  string  `json:"includeAutogen"`
	NewerThanID     int64   `json:"newerThanID"`
	NeedCollections bool    `json:"needCollections"`
	CollectionIDs   []int64 `json:"collectionIDs"`

	ThreadID int64 `json:"threadID"`

	Offset int `json:"offset"`
	Limit  int `json:"limit"`
}

RequestBase replicates ListHappeningReqBase from lifelog

type ServerResponse

type ServerResponse struct {
	Code int             `json:"code"`
	Msg  string          `json:"msg"`
	Data json.RawMessage `json:"data"`
}

ServerResponse wraps all server responses

type StateRecordingHttpService added in v0.0.16

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

StateRecordingHttpService implements storage.StateRecordingService

func (*StateRecordingHttpService) CreateState added in v0.0.16

func (s *StateRecordingHttpService) CreateState(ctx context.Context, state *models.State) (*models.State, error)

func (*StateRecordingHttpService) GetState added in v0.0.16

func (s *StateRecordingHttpService) GetState(ctx context.Context, name string) (*models.State, error)

func (*StateRecordingHttpService) GetStateEvents added in v0.0.16

func (s *StateRecordingHttpService) GetStateEvents(ctx context.Context, stateID int64, limit int) ([]*models.StateEvent, error)

func (*StateRecordingHttpService) GetStateHistory added in v0.0.23

func (*StateRecordingHttpService) ListStates added in v0.0.16

func (s *StateRecordingHttpService) ListStates(ctx context.Context, scope string) ([]*models.State, error)

func (*StateRecordingHttpService) RecordStateEvent added in v0.0.16

func (s *StateRecordingHttpService) RecordStateEvent(ctx context.Context, name string, deltaScore float64) error

type TodoRecordStatus added in v0.0.15

type TodoRecordStatus string

TodoRecordStatus represents the status of a todo record

const (
	TodoRecordStatus_Init    TodoRecordStatus = ""
	TodoRecordStatus_Doing   TodoRecordStatus = "doing"
	TodoRecordStatus_Pending TodoRecordStatus = "pending"
	TodoRecordStatus_Pause   TodoRecordStatus = "pause"
	TodoRecordStatus_Expire  TodoRecordStatus = "expire"
	TodoRecordStatus_Done    TodoRecordStatus = "done"
	TodoRecordStatus_Archive TodoRecordStatus = "archived"
)

Jump to

Keyboard shortcuts

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