kleinTodo/common/types.go

41 lines
1.1 KiB
Go

package common
import "time"
type Credentials struct {
Username string `json:"username" toml:"username"`
Password string `json:"password" toml:"password"`
}
type Todo struct {
Id string `json:"id" toml:"id"`
Name string `json:"name"`
Description string `json:"description"`
Status string `json:"status"`
Owner string `json:"owner"`
SharedWith []string `json:"shared_with,omitzero"`
Labels []string `json:"labels"`
LastModified time.Time `json:"last_modified"`
Deleted bool `json:"deleted"`
}
type StoreTodoRequest struct {
Name string `json:"name"`
Description string `json:"description"`
Status string `json:"status"`
SharedWith []string `json:"shared_with,omitzero"`
}
type TodoList struct {
Todos []Todo `json:"todos"`
}
type MisMatchingTodo struct {
ServerTodo Todo `json:"server_todo"`
LocalTodo Todo `json:"local_todo"`
}
type SyncResponse struct {
SyncedTodos []Todo `json:"synced_todos"`
MisMatchingTodos []MisMatchingTodo `json:"mismatching_todos"`
}