### NewNote Builder Source: https://godocs.io/git.secluded.site/go-lunatask/index_platform=darwin%2Famd64 Starts building a new note. ```APIDOC ## POST /notes ### Description Starts building a note. ### Method POST ### Endpoint /notes ### Response #### Success Response (201) - **NoteBuilder** (*NoteBuilder*) - A builder object to construct the note. #### Error Response (e.g., 500) - **error** (error) - An error object describing the failure. ``` -------------------------------- ### NewTask Builder Source: https://godocs.io/git.secluded.site/go-lunatask/index_platform=darwin%2Famd64 Starts building a task with the given name. ```APIDOC ## POST /tasks ### Description Starts building a task with the given name. ### Method POST ### Endpoint /tasks ### Parameters #### Request Body - **name** (string) - Required - The name of the task. ### Response #### Success Response (201) - **TaskBuilder** (*TaskBuilder*) - A builder object to construct the task. #### Error Response (e.g., 400, 500) - **error** (error) - An error object describing the failure. ``` -------------------------------- ### NewPerson Builder Source: https://godocs.io/git.secluded.site/go-lunatask/index_platform=darwin%2Famd64 Starts building a person entry with the given first and last name. ```APIDOC ## POST /people ### Description Starts building a person entry with the given name. ### Method POST ### Endpoint /people ### Parameters #### Request Body - **firstName** (string) - Required - The first name of the person. - **lastName** (string) - Required - The last name of the person. ### Response #### Success Response (201) - **PersonBuilder** (*PersonBuilder*) - A builder object to construct the person entry. #### Error Response (e.g., 400, 500) - **error** (error) - An error object describing the failure. ``` -------------------------------- ### NewJournalEntry Builder Source: https://godocs.io/git.secluded.site/go-lunatask/index_platform=darwin%2Famd64 Starts building a journal entry for the given date. ```APIDOC ## POST /journal/entries ### Description Starts building a journal entry for the given date. ### Method POST ### Endpoint /journal/entries ### Parameters #### Request Body - **date** (Date) - Required - The date for the journal entry. ### Response #### Success Response (201) - **JournalEntryBuilder** (*JournalEntryBuilder*) - A builder object to construct the journal entry. #### Error Response (e.g., 400, 500) - **error** (error) - An error object describing the failure. ``` -------------------------------- ### Get Workflow Description Source: https://godocs.io/git.secluded.site/go-lunatask/index_platform=windows%2Famd64 Returns a human-readable description of the workflow, suitable for use with Large Language Models (LLMs). ```go func (w Workflow) Description() string ``` -------------------------------- ### Update a Note using NoteUpdateBuilder in Go Source: https://godocs.io/git.secluded.site/go-lunatask/index Shows an example of updating a note using NoteUpdateBuilder. It starts by initializing the builder with a note ID, then chains methods to modify fields like content, and finally calls the Update method. The API accepts updated fields but returns null for encrypted fields upon read. ```go note, err := client.NewNoteUpdate(noteID). WithContent("# Updated content"). Update(ctx) ``` -------------------------------- ### NewPersonUpdate Builder Source: https://godocs.io/git.secluded.site/go-lunatask/index_platform=darwin%2Famd64 Starts building a person update for the given person ID. ```APIDOC ## PUT /people/{personID} ### Description Starts building a person update for the given person ID. ### Method PUT ### Endpoint /people/{personID} ### Parameters #### Path Parameters - **personID** (string) - Required - The ID of the person to update. ### Response #### Success Response (200) - **PersonUpdateBuilder** (*PersonUpdateBuilder*) - A builder object to construct the person update. #### Error Response (e.g., 404, 500) - **error** (error) - An error object describing the failure. ``` -------------------------------- ### Initialize Note Creation with NoteBuilder in Go Source: https://godocs.io/git.secluded.site/go-lunatask/index_platform=windows%2Famd64 NoteBuilder facilitates the creation of new notes through method chaining. It handles client-side encryption of note content and name before sending to the API. The example shows setting name, content, and notebook. ```go type NoteBuilder struct { // contains filtered or unexported fields } // Example Usage: note, err := client.NewNote(). WithName("Meeting notes"). WithContent("# Summary\n\n..."). InNotebook(notebookID). Create(ctx) ``` -------------------------------- ### NewNoteUpdate Builder Source: https://godocs.io/git.secluded.site/go-lunatask/index_platform=darwin%2Famd64 Starts building a note update for the given note ID. ```APIDOC ## PUT /notes/{noteID} ### Description Starts building a note update for the given note ID. ### Method PUT ### Endpoint /notes/{noteID} ### Parameters #### Path Parameters - **noteID** (string) - Required - The ID of the note to update. ### Response #### Success Response (200) - **NoteUpdateBuilder** (*NoteUpdateBuilder*) - A builder object to construct the note update. #### Error Response (e.g., 404, 500) - **error** (error) - An error object describing the failure. ``` -------------------------------- ### NewTaskUpdate Builder Source: https://godocs.io/git.secluded.site/go-lunatask/index_platform=darwin%2Famd64 Starts building a task update for the given task ID. ```APIDOC ## PUT /tasks/{taskID} ### Description Starts building a task update for the given task ID. ### Method PUT ### Endpoint /tasks/{taskID} ### Parameters #### Path Parameters - **taskID** (string) - Required - The ID of the task to update. ### Response #### Success Response (200) - **TaskUpdateBuilder** (*TaskUpdateBuilder*) - A builder object to construct the task update. #### Error Response (e.g., 404, 500) - **error** (error) - An error object describing the failure. ``` -------------------------------- ### Create a Timeline Note in Go Source: https://godocs.io/git.secluded.site/go-lunatask/index Illustrates the creation of a timeline note using the TimelineNoteBuilder. This builder allows chaining methods to specify the note's content, date, and associated person. The content is client-side encrypted and not returned on read. The example shows creating a note for a specific date with provided content. ```go note, err := client.NewTimelineNote(personID). OnDate(lunatask.Today()). WithContent("Had coffee, discussed the project."). Create(ctx) ``` -------------------------------- ### Create Task using TaskBuilder in Go Source: https://godocs.io/git.secluded.site/go-lunatask/index Example of creating a new task using the TaskBuilder. This demonstrates chaining methods to set properties like name, area, status, and estimate before finally creating the task. ```Go task, err := client.NewTask("Review PR"). InArea(areaID). WithStatus(lunatask.StatusNext). WithEstimate(30). Create(ctx) ``` -------------------------------- ### NewTimelineNote Builder Source: https://godocs.io/git.secluded.site/go-lunatask/index_platform=darwin%2Famd64 Starts building a timeline note for the given person. Person IDs can be obtained from Client.ListPeople. ```APIDOC ## POST /timeline/notes ### Description Starts building a timeline note for the given person. Get person IDs from Client.ListPeople. ### Method POST ### Endpoint /timeline/notes ### Parameters #### Request Body - **personID** (string) - Required - The ID of the person for whom the timeline note is created. ### Response #### Success Response (201) - **TimelineNoteBuilder** (*TimelineNoteBuilder*) - A builder object to construct the timeline note. #### Error Response (e.g., 400, 500) - **error** (error) - An error object describing the failure. ``` -------------------------------- ### Motivation Utility Functions Source: https://godocs.io/git.secluded.site/go-lunatask/index_platform=js%2Fwasm Offers utilities for managing motivation types within the Lunatask system. It includes functions to retrieve all available motivations, parse a motivation from a string, and get the string representation of a motivation. This helps in categorizing and displaying motivational content. ```go type Motivation func AllMotivations() []Motivation func ParseMotivation(str string) (Motivation, error) func (m Motivation) String() string ``` -------------------------------- ### Build and Update a Task in Go Source: https://godocs.io/git.secluded.site/go-lunatask/index Demonstrates how to use the TaskUpdateBuilder to construct and modify a task. The builder pattern allows for method chaining to set various task properties like status, completion time, importance, and more. Only specified fields are updated, leaving others unchanged. The example shows updating a task's status to 'completed' and setting its completion time. ```go task, err := client.NewTaskUpdate(taskID). WithStatus(lunatask.StatusCompleted). CompletedAt(time.Now()). Update(ctx) ``` -------------------------------- ### Initialize and Ping Lunatask Client in Go Source: https://godocs.io/git.secluded.site/go-lunatask/index Demonstrates how to create a new Lunatask client using an environment variable for the API token and a custom user agent. It then performs a Ping operation to check the API's responsiveness. Requires the context package and logging utilities. ```go client := lunatask.NewClient(os.Getenv("LUNATASK_TOKEN"), lunatask.UserAgent("MyApp/1.0")) if _, err := client.Ping(ctx); err != nil { log.Fatal(err) } ``` -------------------------------- ### Date Utility Functions Source: https://godocs.io/git.secluded.site/go-lunatask/index_platform=js%2Fwasm Provides utility functions for working with dates in the Lunatask system. This includes creating a Date from time.Time, parsing a date string, getting the current date, and methods for JSON marshaling/unmarshaling and string representation. These functions ensure consistent date handling. ```go type Date func NewDate(t time.Time) Date func ParseDate(s string) (Date, error) func Today() Date func (d Date) MarshalJSON() ([]byte, error) func (d *Date) String() string func (d *Date) UnmarshalJSON(data []byte) error ``` -------------------------------- ### Get Today's Date Source: https://godocs.io/git.secluded.site/go-lunatask/index Returns a Date object representing the current day. This is a convenient way to get the current date. ```go func Today() Date ``` -------------------------------- ### Client Initialization and Options Source: https://godocs.io/git.secluded.site/go-lunatask/index_platform=js%2Fwasm Provides functionality to create and configure a new Lunatask API client. The NewClient function initializes the client with an access token and allows for optional configurations such as setting a custom base URL, HTTP client, or user agent. This enables flexible integration with the Lunatask API. ```go func NewClient(accessToken string, opts ...Option) *Client type Option func BaseURL(url string) Option func HTTPClient(client *http.Client) Option func UserAgent(ua string) Option ``` -------------------------------- ### Client Initialization Source: https://godocs.io/git.secluded.site/go-lunatask/index Initializes a new Go-Lunatask client with an access token and optional configurations. ```APIDOC ## Client Initialization ### Description Initializes a new Go-Lunatask client. An access token is required for authentication. Optional configuration options like BaseURL, HTTPClient, and UserAgent can be provided. ### Method `NewClient` ### Parameters - **accessToken** (string) - Required - The access token for authentication. - **opts** (*Option) - Optional - A variadic list of options to configure the client. - `BaseURL(url string)`: Sets a custom base URL for the API. - `HTTPClient(client *http.Client)`: Provides a custom HTTP client. - `UserAgent(ua string)`: Sets a custom User-Agent header. ### Response - ***Client** - A pointer to the initialized Client. ### Request Example ```go client := lunatask.NewClient("your_access_token", lunatask.BaseURL("https://api.example.com")) ``` ``` -------------------------------- ### Create a New Note using NoteBuilder in Go Source: https://godocs.io/git.secluded.site/go-lunatask/index Demonstrates how to use the NoteBuilder to construct and create a new note. This involves chaining methods to set the name, content, and notebook before calling the Create method. Note fields are encrypted client-side. ```go note, err := client.NewNote(). WithName("Meeting notes"). WithContent("# Summary\n\n..."). InNotebook(notebookID). Create(ctx) ``` -------------------------------- ### NoteBuilder Methods Source: https://godocs.io/git.secluded.site/go-lunatask/index_platform=js%2Fwasm Defines methods for the NoteBuilder to construct and create notes. The WithName, WithContent, InNotebook, and FromSource methods allow setting note properties, while the Create method sends the note to the API. This builder pattern simplifies note creation. ```go func (b *NoteBuilder) Create(ctx context.Context) (*Note, error) func (b *NoteBuilder) FromSource(source, sourceID string) *NoteBuilder func (b *NoteBuilder) InNotebook(notebookID string) *NoteBuilder func (b *NoteBuilder) WithContent(content string) *NoteBuilder func (b *NoteBuilder) WithName(name string) *NoteBuilder ``` -------------------------------- ### Client Configuration Source: https://godocs.io/git.secluded.site/go-lunatask/index_platform=linux%2Famd64 Options for configuring the Lunatask client. ```APIDOC ## Client Options ### Description Options for configuring the `Client`. ### Functions #### func BaseURL(url string) ##### Description Sets a custom base URL (useful for testing). ##### Parameters - **url** (string) - The custom base URL. ##### Returns - `Option`: An Option function to configure the client. #### func HTTPClient(client *http.Client) ##### Description Sets a custom HTTP client. ##### Parameters - **client** (*http.Client) - The custom HTTP client. ##### Returns - `Option`: An Option function to configure the client. #### func UserAgent(ua string) ##### Description Sets a custom User-Agent prefix. The library identifier (go-lunatask/version) is always appended. ##### Parameters - **ua** (string) - The custom User-Agent prefix. ##### Returns - `Option`: An Option function to configure the client. ``` -------------------------------- ### NewNote Builder Source: https://godocs.io/git.secluded.site/go-lunatask/index_platform=linux%2Famd64 Initiates the creation of a new note. ```APIDOC ## POST /notes ### Description Starts building a note. ### Method POST ### Endpoint `/notes` ### Response #### Success Response (201 Created) - **NoteBuilder** (*NoteBuilder) - A builder object to construct the note. #### Error Response (e.g., 500 Internal Server Error) - **error** (error) - An error object describing the failure. ``` -------------------------------- ### Get All Valid Workflow Values Source: https://godocs.io/git.secluded.site/go-lunatask/index_platform=windows%2Famd64 Returns a slice containing all defined valid Workflow values. ```go func Workflows() []Workflow ``` -------------------------------- ### Get Valid Task Statuses for Workflow Source: https://godocs.io/git.secluded.site/go-lunatask/index_platform=windows%2Famd64 Returns a slice of TaskStatus values that are applicable to the current workflow. ```go func (w Workflow) ValidStatuses() []TaskStatus ``` -------------------------------- ### TaskBuilder Methods for Task Configuration in Go Source: https://godocs.io/git.secluded.site/go-lunatask/index This section details various methods available on the TaskBuilder to configure a task before creation. These include setting completion time, source information, importance, urgency, priority, schedule date, estimate, motivation, note, and status. ```Go func (b *TaskBuilder) CompletedAt(t time.Time) *TaskBuilder func (b *TaskBuilder) FromSource(source, sourceID string) *TaskBuilder func (b *TaskBuilder) Important() *TaskBuilder func (b *TaskBuilder) InArea(areaID string) *TaskBuilder func (b *TaskBuilder) InGoal(goalID string) *TaskBuilder func (b *TaskBuilder) NotImportant() *TaskBuilder func (b *TaskBuilder) NotUrgent() *TaskBuilder func (b *TaskBuilder) Priority(p Priority) *TaskBuilder func (b *TaskBuilder) ScheduledOn(date Date) *TaskBuilder func (b *TaskBuilder) Urgent() *TaskBuilder func (b *TaskBuilder) WithEisenhower(eisenhower Eisenhower) *TaskBuilder func (b *TaskBuilder) WithEstimate(minutes int) *TaskBuilder func (b *TaskBuilder) WithMotivation(motivation Motivation) *TaskBuilder func (b *TaskBuilder) WithNote(note string) *TaskBuilder func (b *TaskBuilder) WithStatus(status TaskStatus) *TaskBuilder ``` -------------------------------- ### Client Configuration Options Source: https://godocs.io/git.secluded.site/go-lunatask/index_platform=windows%2Famd64 Options for configuring the Lunatask client, including setting a custom base URL, HTTP client, or User-Agent. ```APIDOC ## Client Configuration ### Description Provides options to configure the behavior of the Lunatask client. ### Options #### BaseURL Sets a custom base URL for the API. Useful for testing or connecting to different environments. #### HTTPClient Allows setting a custom `http.Client` for making requests. #### UserAgent Sets a custom User-Agent prefix. The library identifier (`go-lunatask/version`) is always appended. ``` -------------------------------- ### Get Source Filter for Tasks (Go) Source: https://godocs.io/git.secluded.site/go-lunatask/index GetSource implements the SourceFilter interface for ListTasksOptions, returning the source integration string. ```Go func (o *ListTasksOptions) GetSource() *string ``` -------------------------------- ### Get Source Filter for People (Go) Source: https://godocs.io/git.secluded.site/go-lunatask/index GetSource implements the SourceFilter interface for ListPeopleOptions, returning the source integration string. ```Go func (o *ListPeopleOptions) GetSource() *string ``` -------------------------------- ### Get Source Filter for Notes (Go) Source: https://godocs.io/git.secluded.site/go-lunatask/index GetSource implements the SourceFilter interface for ListNotesOptions, returning the source integration string. ```Go func (o *ListNotesOptions) GetSource() *string ``` -------------------------------- ### ListNotesOptions Source: https://godocs.io/git.secluded.site/go-lunatask/index_platform=js%2Fwasm Options for filtering notes based on source integration. ```APIDOC ## Type: ListNotesOptions ### Description ListNotesOptions provides filters to retrieve notes associated with a specific source integration. ### Fields - **Source** (*string): The name of the source integration (e.g., "github", "gitlab"). - **SourceID** (*string): The unique identifier within the source integration. ### Methods #### GetSource ##### Description Returns the source integration name. ##### Method Signature ```go func (o *ListNotesOptions) GetSource() *string ``` #### GetSourceID ##### Description Returns the source-specific ID. ##### Method Signature ```go func (o *ListNotesOptions) GetSourceID() *string ``` ``` -------------------------------- ### Get Source ID Filter for Tasks (Go) Source: https://godocs.io/git.secluded.site/go-lunatask/index GetSourceID implements the SourceFilter interface for ListTasksOptions, returning the source integration ID string. ```Go func (o *ListTasksOptions) GetSourceID() *string ``` -------------------------------- ### Initialize lunatask Client Source: https://godocs.io/git.secluded.site/go-lunatask/index Creates a new lunatask client. It requires an access token and accepts optional configuration options such as BaseURL, HTTPClient, and UserAgent. ```go func NewClient(accessToken string, opts ...Option) *Client ``` -------------------------------- ### Get Source ID Filter for People (Go) Source: https://godocs.io/git.secluded.site/go-lunatask/index GetSourceID implements the SourceFilter interface for ListPeopleOptions, returning the source integration ID string. ```Go func (o *ListPeopleOptions) GetSourceID() *string ``` -------------------------------- ### Create New Note Builder Source: https://godocs.io/git.secluded.site/go-lunatask/index Initiates the creation of a new note using a builder pattern. It returns a NoteBuilder instance for further configuration. ```go func (c *Client) NewNote() *NoteBuilder ``` -------------------------------- ### Get Source ID Filter for Notes (Go) Source: https://godocs.io/git.secluded.site/go-lunatask/index GetSourceID implements the SourceFilter interface for ListNotesOptions, returning the source integration ID string. ```Go func (o *ListNotesOptions) GetSourceID() *string ``` -------------------------------- ### API Client and Operations Source: https://godocs.io/git.secluded.site/go-lunatask/index_platform=linux%2Famd64 Documentation for the Lunatask API client, including initialization and methods for deleting notes and people. ```APIDOC ## API Client and Operations ### Client Initialization Creates a new Lunatask API client. **Method:** N/A (Function) **Endpoint:** N/A **Parameters:** #### Path Parameters - None #### Query Parameters - None #### Request Body - **accessToken** (string) - Your Lunatask API access token. - **opts** (...Option) - Optional configuration options for the client. ### Request Example ```go // Example usage (not a direct API call) // accessToken := "your_access_token" // client := NewClient(accessToken) ``` ### DeleteNote Removes a note and returns its final state. **Method:** DELETE **Endpoint:** `/notes/{noteID}` (Note: This is an inferred endpoint based on function name and parameters) **Parameters:** #### Path Parameters - **noteID** (string) - Required - The ID of the note to delete. #### Query Parameters - None #### Request Body - None ### Request Example ```go // Example usage (not a direct API call) // ctx := context.Background() // noteID := "some_note_id" // deletedNote, err := client.DeleteNote(ctx, noteID) // if err != nil { // // Handle error // } ``` ### Response #### Success Response (200) - **Note** (*Note) - The deleted note object. #### Response Example ```json { "id": "some_note_id", "content": "This note was deleted." } ``` ### DeletePerson Removes a person and returns their final state. **Method:** DELETE **Endpoint:** `/people/{personID}` (Note: This is an inferred endpoint based on function name and parameters) **Parameters:** #### Path Parameters - **personID** (string) - Required - The ID of the person to delete. #### Query Parameters - None #### Request Body - None ### Request Example ```go // Example usage (not a direct API call) // ctx := context.Background() // personID := "some_person_id" // deletedPerson, err := client.DeletePerson(ctx, personID) // if err != nil { // // Handle error // } ``` ### Response #### Success Response (200) - **Person** (*Person) - The deleted person object. #### Response Example ```json { "id": "some_person_id", "name": "Deleted Person" } ``` ``` -------------------------------- ### Get All Motivation Values in Go Source: https://godocs.io/git.secluded.site/go-lunatask/index_platform=windows%2Famd64 The AllMotivations function returns a slice of all valid Motivation values. This includes MotivationUnknown, which is used to clear or unset the motivation. ```go func AllMotivations() []Motivation ``` -------------------------------- ### Filter Tasks by Source (Go) Source: https://godocs.io/git.secluded.site/go-lunatask/index_platform=windows%2Famd64 Defines the ListTasksOptions struct for filtering tasks based on source integration. It includes methods to get the source and source ID. ```go type ListTasksOptions struct { Source *string SourceID *string } func (o *ListTasksOptions) GetSource() *string { return o.Source } func (o *ListTasksOptions) GetSourceID() *string { return o.SourceID } ``` -------------------------------- ### NewPerson Builder Source: https://godocs.io/git.secluded.site/go-lunatask/index_platform=linux%2Famd64 Initiates the creation of a new person entry with the provided first and last names. ```APIDOC ## POST /people ### Description Starts building a person entry with the given name. ### Method POST ### Endpoint `/people` ### Parameters #### Request Body - **firstName** (string) - Required - The first name of the person. - **lastName** (string) - Required - The last name of the person. ### Response #### Success Response (201 Created) - **PersonBuilder** (*PersonBuilder) - A builder object to construct the person entry. #### Error Response (e.g., 400 Bad Request, 500 Internal Server Error) - **error** (error) - An error object describing the failure. ``` -------------------------------- ### NewTask Builder Source: https://godocs.io/git.secluded.site/go-lunatask/index_platform=linux%2Famd64 Initiates the creation of a new task with the provided name. ```APIDOC ## POST /tasks ### Description Starts building a task with the given name. ### Method POST ### Endpoint `/tasks` ### Parameters #### Request Body - **name** (string) - Required - The name of the task. ### Response #### Success Response (201 Created) - **TaskBuilder** (*TaskBuilder) - A builder object to construct the task. #### Error Response (e.g., 400 Bad Request, 500 Internal Server Error) - **error** (error) - An error object describing the failure. ``` -------------------------------- ### Filter People by Source (Go) Source: https://godocs.io/git.secluded.site/go-lunatask/index_platform=windows%2Famd64 Defines the ListPeopleOptions struct for filtering people based on source integration. It includes methods to get the source and source ID. ```go type ListPeopleOptions struct { Source *string SourceID *string } func (o *ListPeopleOptions) GetSource() *string { return o.Source } func (o *ListPeopleOptions) GetSourceID() *string { return o.SourceID } ``` -------------------------------- ### TaskBuilder Methods for Task Creation (Go) Source: https://godocs.io/git.secluded.site/go-lunatask/index Provides methods for building and creating a Task. These methods allow setting various attributes of a task before its creation. ```go func (b *TaskBuilder) CompletedAt(t time.Time) *TaskBuilder func (b *TaskBuilder) Create(ctx context.Context) (*Task, error) func (b *TaskBuilder) FromSource(source, sourceID string) *TaskBuilder func (b *TaskBuilder) Important() *TaskBuilder func (b *TaskBuilder) InArea(areaID string) *TaskBuilder func (b *TaskBuilder) InGoal(goalID string) *TaskBuilder func (b *TaskBuilder) NotImportant() *TaskBuilder func (b *TaskBuilder) NotUrgent() *TaskBuilder func (b *TaskBuilder) Priority(p Priority) *TaskBuilder func (b *TaskBuilder) ScheduledOn(date Date) *TaskBuilder func (b *TaskBuilder) Urgent() *TaskBuilder func (b *TaskBuilder) WithEisenhower(eisenhower Eisenhower) *TaskBuilder func (b *TaskBuilder) WithEstimate(minutes int) *TaskBuilder func (b *TaskBuilder) WithMotivation(motivation Motivation) *TaskBuilder func (b *TaskBuilder) WithNote(note string) *TaskBuilder func (b *TaskBuilder) WithStatus(status TaskStatus) *TaskBuilder ``` -------------------------------- ### Filter Notes by Source (Go) Source: https://godocs.io/git.secluded.site/go-lunatask/index_platform=windows%2Famd64 Defines the ListNotesOptions struct for filtering notes based on source integration. It includes methods to get the source and source ID. ```go type ListNotesOptions struct { Source *string SourceID *string } func (o *ListNotesOptions) GetSource() *string { return o.Source } func (o *ListNotesOptions) GetSourceID() *string { return o.SourceID } ``` -------------------------------- ### Task Creation API Source: https://godocs.io/git.secluded.site/go-lunatask/index_platform=darwin%2Famd64 Constructs and creates a new task using a builder pattern. ```APIDOC ## POST /tasks ### Description Constructs and creates a new task via method chaining. This endpoint uses a builder pattern to define task properties before creation. ### Method POST ### Endpoint /tasks ### Parameters #### Request Body - **task_details** (object) - Required - Object containing details for task creation. - **name** (string) - Required - The name of the task. - **area_id** (string) - Optional - The ID of the area the task belongs to. - **status** (string) - Optional - The initial status of the task (e.g., "next", "in-progress"). - **estimate** (integer) - Optional - The estimated time to complete the task in minutes. - **completed_at** (string) - Optional - The timestamp when the task was completed (ISO 8601 format). ### Request Example ```json { "task_details": { "name": "Implement User Authentication", "area_id": "area-abc", "status": "next", "estimate": 60 } } ``` ### Response #### Success Response (200) - **task** (object) - The newly created task object. - **id** (string) - The unique identifier of the created task. - **name** (string) - The name of the task. - **area_id** (string) - The ID of the area the task belongs to. - **status** (string) - The current status of the task. - **estimate** (integer) - The estimated time to complete the task in minutes. - **completed_at** (string) - The timestamp when the task was completed (ISO 8601 format). - **created_at** (string) - The timestamp when the task was created (ISO 8601 format). - **updated_at** (string) - The timestamp when the task was last updated (ISO 8601 format). #### Response Example ```json { "task": { "id": "task-456", "name": "Implement User Authentication", "area_id": "area-abc", "status": "next", "estimate": 60, "completed_at": null, "created_at": "2023-10-27T10:00:00Z", "updated_at": "2023-10-27T10:00:00Z" } } ``` ``` -------------------------------- ### Unmarshal JSON to TaskStatus Source: https://godocs.io/git.secluded.site/go-lunatask/index_platform=windows%2Famd64 The UnmarshalJSON method implements the json.Unmarshaler interface for TaskStatus. It handles the translation of 'started' received from the API back to the internal 'in-progress' status. ```go func (s *TaskStatus) UnmarshalJSON(data []byte) error ``` -------------------------------- ### Workflow Management API Source: https://godocs.io/git.secluded.site/go-lunatask/index_platform=js%2Fwasm Provides functionalities to manage and query task workflows. This includes getting all available workflows, parsing workflow strings, and retrieving workflow-specific details. ```APIDOC ## Workflow Management ### Description Manages and provides information about different task workflows. ### Functions #### `Workflows()` - **Description**: Returns a list of all valid workflow values. - **Method**: GET - **Endpoint**: N/A (Function call within the application) - **Response Example**: ```json [ "priority_list", "now_later", "kanban", "plan_your_days", "must_should_want", "eisenhower" ] ``` #### `ParseWorkflow(str string)` - **Description**: Parses a string into a `Workflow` value (case-insensitive). Accepts snake_case and kebab-case. - **Method**: POST (Conceptual, as it's a parsing function) - **Endpoint**: N/A (Function call within the application) - **Parameters**: - **str** (string) - Required - The string to parse into a Workflow. - **Response Example**: ```json { "workflow": "priority_list", "error": null } ``` #### `Workflow.Description()` - **Description**: Returns a human-readable description of the workflow. - **Method**: GET (Conceptual) - **Endpoint**: N/A (Method on a Workflow object) #### `Workflow.String()` - **Description**: Returns the workflow value as a string. - **Method**: GET (Conceptual) - **Endpoint**: N/A (Method on a Workflow object) #### `Workflow.UsesEisenhower()` - **Description**: Reports whether this workflow uses the important/urgent fields. - **Method**: GET (Conceptual) - **Endpoint**: N/A (Method on a Workflow object) - **Response**: boolean #### `Workflow.UsesMotivation()` - **Description**: Reports whether this workflow uses the motivation field (must/should/want). - **Method**: GET (Conceptual) - **Endpoint**: N/A (Method on a Workflow object) - **Response**: boolean #### `Workflow.UsesPriority()` - **Description**: Reports whether this workflow uses only priority (no status columns). - **Method**: GET (Conceptual) - **Endpoint**: N/A (Method on a Workflow object) - **Response**: boolean #### `Workflow.UsesScheduling()` - **Description**: Reports whether this workflow is date-oriented (scheduled_on). - **Method**: GET (Conceptual) - **Endpoint**: N/A (Method on a Workflow object) - **Response**: boolean #### `Workflow.ValidStatuses()` - **Description**: Returns the task statuses that apply to this workflow. - **Method**: GET (Conceptual) - **Endpoint**: N/A (Method on a Workflow object) - **Response Example**: ```json [ "todo", "in_progress", "done" ] ``` ``` -------------------------------- ### Get All Task Statuses Source: https://godocs.io/git.secluded.site/go-lunatask/index_platform=windows%2Famd64 The AllTaskStatuses function returns a slice containing all valid TaskStatus values, ordered according to the workflow. This is useful for iterating through or displaying available statuses. ```go func AllTaskStatuses() []TaskStatus ``` -------------------------------- ### List Options for Integrations Source: https://godocs.io/git.secluded.site/go-lunatask/index_platform=linux%2Famd64 Options for filtering lists of notes, people, and tasks based on source integrations. ```APIDOC ## List Options for Integrations ### Type: `ListNotesOptions` Filters notes by source integration. - **Source** (*string): The source integration to filter by. - **SourceID** (*string): The specific ID within the source integration to filter by. #### `(*ListNotesOptions) GetSource() *string` Implements `SourceFilter` for Source. #### `(*ListNotesOptions) GetSourceID() *string` Implements `SourceFilter` for SourceID. ### Type: `ListPeopleOptions` Filters people by source integration. - **Source** (*string): The source integration to filter by. - **SourceID** (*string): The specific ID within the source integration to filter by. #### `(*ListPeopleOptions) GetSource() *string` Implements `SourceFilter` for Source. #### `(*ListPeopleOptions) GetSourceID() *string` Implements `SourceFilter` for SourceID. ### Type: `ListTasksOptions` Filters tasks by source integration. - **Source** (*string): The source integration to filter by. - **SourceID** (*string): The specific ID within the source integration to filter by. #### `(*ListTasksOptions) GetSource() *string` Implements `SourceFilter` for Source. #### `(*ListTasksOptions) GetSourceID() *string` Implements `SourceFilter` for SourceID. ``` -------------------------------- ### Get All Relationship Strengths in Go Source: https://godocs.io/git.secluded.site/go-lunatask/index_platform=linux%2Famd64 The AllRelationshipStrengths function returns a slice of all defined RelationshipStrength values, ordered from closest to most distant. This is useful for populating selection lists or validation. ```Go func AllRelationshipStrengths() []RelationshipStrength { // Implementation to return all relationship strengths } ``` -------------------------------- ### Create Journal Entry with Builder (Go) Source: https://godocs.io/git.secluded.site/go-lunatask/index Demonstrates using the JournalEntryBuilder to construct and create a journal entry. It shows method chaining for setting content and then calling the Create method. Client-side encryption means Name and Content won't round-trip. ```Go entry, err := client.NewJournalEntry(lunatask.Today()). WithContent("Shipped the new feature!"). Create(ctx) ``` -------------------------------- ### TimelineNoteBuilder Methods for Timeline Notes (Go) Source: https://godocs.io/git.secluded.site/go-lunatask/index Provides methods for building and creating a PersonTimelineNote. These methods allow setting the date and content of a timeline note. ```go func (b *TimelineNoteBuilder) Create(ctx context.Context) (*PersonTimelineNote, error) func (b *TimelineNoteBuilder) OnDate(date Date) *TimelineNoteBuilder func (b *TimelineNoteBuilder) WithContent(content string) *TimelineNoteBuilder ``` -------------------------------- ### Marshal TaskStatus to JSON Source: https://godocs.io/git.secluded.site/go-lunatask/index_platform=windows%2Famd64 The MarshalJSON method implements the json.Marshaler interface for TaskStatus. It specifically translates the internal 'in-progress' status to 'started' when marshalling to JSON for API compatibility. ```go func (s TaskStatus) MarshalJSON() ([]byte, error) ``` -------------------------------- ### Get All Relationship Strengths Go Source: https://godocs.io/git.secluded.site/go-lunatask/index_platform=windows%2Famd64 The AllRelationshipStrengths function returns a slice containing all defined RelationshipStrength values, ordered from closest to most distant. This is useful for populating selection lists or validation. ```go func AllRelationshipStrengths() []RelationshipStrength { // Implementation to return all relationship strengths } ``` -------------------------------- ### Resource Parsing API Source: https://godocs.io/git.secluded.site/go-lunatask/index_platform=windows%2Famd64 APIs for parsing deep links and references into Resource objects. ```APIDOC ## POST /resources/parse/deeplink ### Description Parses a deep link string into a Resource object. ### Method POST ### Endpoint /resources/parse/deeplink ### Parameters #### Request Body - **input** (string) - Required - The deep link string to parse. ### Request Example ```json { "input": "lunatask://tasks/123e4567-e89b-12d3-a456-426614174000" } ``` ### Response #### Success Response (200) - **resource** (Resource) - The parsed Resource object. - **remaining** (string) - Any remaining part of the input string after parsing. - **error** (error) - An error if parsing failed. #### Response Example ```json { "resource": { "type": "task", "id": "123e4567-e89b-12d3-a456-426614174000" }, "remaining": "", "error": null } ``` ## POST /resources/parse/reference ### Description Parses a reference string into a Resource object. ### Method POST ### Endpoint /resources/parse/reference ### Parameters #### Request Body - **input** (string) - Required - The reference string to parse. ### Request Example ```json { "input": "task:123e4567-e89b-12d3-a456-426614174000" } ``` ### Response #### Success Response (200) - **resource** (Resource) - The parsed Resource object. - **remaining** (string) - Any remaining part of the input string after parsing. - **error** (error) - An error if parsing failed. #### Response Example ```json { "resource": { "type": "task", "id": "123e4567-e89b-12d3-a456-426614174000" }, "remaining": "", "error": null } ``` ``` -------------------------------- ### Get All Relationship Strengths in Go Source: https://godocs.io/git.secluded.site/go-lunatask/index_platform=darwin%2Famd64 The AllRelationshipStrengths function returns a slice containing all defined RelationshipStrength values, ordered from closest to most distant. This is useful for populating dropdowns or validation lists. ```go func AllRelationshipStrengths() []RelationshipStrength { // Implementation to return all relationship strengths } ``` -------------------------------- ### Other Client Methods Source: https://godocs.io/git.secluded.site/go-lunatask/index_platform=windows%2Famd64 Additional client methods for pinging the server, tracking habits, and building journal entries. ```APIDOC ## Other Client Methods ### Description This section details miscellaneous client methods, including checking server connectivity with a ping, tracking habit activities, and initiating the creation of journal entries. ### Methods #### Ping ##### Method `Ping(ctx context.Context) (*PingResponse, error)` ##### Parameters * **ctx** (context.Context) - Required - The context for the request. ##### Response * ***PingResponse** - The response from the ping request, indicating server status. * **error** - An error if the ping request failed. #### Track Habit Activity ##### Method `TrackHabitActivity(ctx context.Context, habitID string, request *TrackHabitActivityRequest) (*TrackHabitActivityResponse, error)` ##### Parameters * **ctx** (context.Context) - Required - The context for the request. * **habitID** (string) - Required - The ID of the habit to track activity for. * **request** (*TrackHabitActivityRequest) - Required - The request body containing activity details. ##### Response * ***TrackHabitActivityResponse** - The response confirming the habit activity tracking. * **error** - An error if tracking failed. #### New Journal Entry ##### Method `NewJournalEntry(date Date) *JournalEntryBuilder` ##### Parameters * **date** (Date) - Required - The date for the journal entry. ##### Response * ***JournalEntryBuilder** - A builder object for constructing and creating a new journal entry. ###### Builder Methods * `WithName(name string) *JournalEntryBuilder`: Sets the name of the journal entry. * `WithContent(content string) *JournalEntryBuilder`: Sets the content of the journal entry. * `Create(ctx context.Context) (*JournalEntry, error)`: Creates the journal entry. ``` -------------------------------- ### Get Person using lunatask Client Source: https://godocs.io/git.secluded.site/go-lunatask/index Retrieves a person from lunatask using their ID. This function requires a context and the person ID as input and returns the person object or an error. ```go func (c *Client) GetPerson(ctx context.Context, personID string) (*Person, error) ``` -------------------------------- ### List Options Source: https://godocs.io/git.secluded.site/go-lunatask/index_platform=windows%2Famd64 Provides options for filtering lists of notes, people, and tasks based on source integration. ```APIDOC ## Type: ListNotesOptions ### Description Filters notes by source integration. ### Fields - `Source` (*string): The source integration to filter by. - `SourceID` (*string): The specific source ID to filter by. ### Methods #### `GetSource() *string` ##### Description Implements `SourceFilter` to get the source. #### `GetSourceID() *string` ##### Description Implements `SourceFilter` to get the source ID. ## Type: ListPeopleOptions ### Description Filters people by source integration. ### Fields - `Source` (*string): The source integration to filter by. - `SourceID` (*string): The specific source ID to filter by. ### Methods #### `GetSource() *string` ##### Description Implements `SourceFilter` to get the source. #### `GetSourceID() *string` ##### Description Implements `SourceFilter` to get the source ID. ## Type: ListTasksOptions ### Description Filters tasks by source integration. ### Fields - `Source` (*string): The source integration to filter by. - `SourceID` (*string): The specific source ID to filter by. ### Methods #### `GetSource() *string` ##### Description Implements `SourceFilter` to get the source. #### `GetSourceID() *string` ##### Description Implements `SourceFilter` to get the source ID. ``` -------------------------------- ### Get Note using lunatask Client Source: https://godocs.io/git.secluded.site/go-lunatask/index Retrieves a note from lunatask using its ID. This function requires a context and the note ID as input and returns the note object or an error. ```go func (c *Client) GetNote(ctx context.Context, noteID string) (*Note, error) ``` -------------------------------- ### List Options Source: https://godocs.io/git.secluded.site/go-lunatask/index_platform=darwin%2Famd64 Options for filtering lists of notes, people, and tasks by source integration. ```APIDOC ## Type: ListNotesOptions ### Description Filters notes by source integration. ### Fields - **Source** (*string): The source integration to filter by. - **SourceID** (*string): The source ID to filter by. ### Methods - **(*ListNotesOptions) GetSource() *string**: Returns the source filter. - **(*ListNotesOptions) GetSourceID() *string**: Returns the source ID filter. ## Type: ListPeopleOptions ### Description Filters people by source integration. ### Fields - **Source** (*string): The source integration to filter by. - **SourceID** (*string): The source ID to filter by. ### Methods - **(*ListPeopleOptions) GetSource() *string**: Returns the source filter. - **(*ListPeopleOptions) GetSourceID() *string**: Returns the source ID filter. ## Type: ListTasksOptions ### Description Filters tasks by source integration. ### Fields - **Source** (*string): The source integration to filter by. - **SourceID** (*string): The source ID to filter by. ### Methods - **(*ListTasksOptions) GetSource() *string**: Returns the source filter. - **(*ListTasksOptions) GetSourceID() *string**: Returns the source ID filter. ``` -------------------------------- ### Get Task using lunatask Client Source: https://godocs.io/git.secluded.site/go-lunatask/index Retrieves a task from lunatask using its ID. This function requires a context and the task ID as input and returns the task object or an error. ```go func (c *Client) GetTask(ctx context.Context, taskID string) (*Task, error) ``` -------------------------------- ### ListNotes API Source: https://godocs.io/git.secluded.site/go-lunatask/index_platform=darwin%2Famd64 Returns all notes, optionally filtered. Pass nil for all notes. ```APIDOC ## GET /notes ### Description Returns all notes, optionally filtered. Pass nil for all notes. ### Method GET ### Endpoint /notes ### Parameters #### Query Parameters - **ListNotesOptions** (*ListNotesOptions*) - Optional - Options to filter the list of notes. ### Response #### Success Response (200) - **[]Note** (*[]Note*) - A slice of Note objects. #### Response Example ```json [ { "id": "note_abc123", "name": null, "content": null, "createdAt": "2023-10-27T10:00:00Z", "updatedAt": "2023-10-27T10:00:00Z" } ] ``` #### Error Response (e.g., 500) - **error** (error) - An error object describing the failure. ``` -------------------------------- ### Workflow Management API Source: https://godocs.io/git.secluded.site/go-lunatask/index_platform=darwin%2Famd64 Provides functionality to manage and query workflow types. This includes retrieving all valid workflows, parsing workflow strings, and getting descriptions or properties of specific workflows. ```APIDOC ## Workflow Management ### Description APIs for managing and querying task management workflows. ### Functions #### Get All Workflows ##### Description Returns a list of all valid workflow types. ##### Method GET ##### Endpoint /workflows ##### Response #### Success Response (200) - **workflows** (array of strings) - A list of valid workflow identifiers. ##### Response Example ```json [ "priority_list", "now_later", "kanban", "plan_your_days", "must_should_want", "eisenhower" ] ``` #### Parse Workflow ##### Description Parses a string into a Workflow value. Accepts snake_case or kebab-case. ##### Method POST ##### Endpoint /workflows/parse ##### Parameters - **str** (string) - Required - The string to parse into a Workflow. ##### Request Example ```json { "str": "priority_list" } ``` ##### Response #### Success Response (200) - **workflow** (string) - The parsed Workflow value. - **error** (string, optional) - An error message if parsing fails. ##### Response Example ```json { "workflow": "priority_list" } ``` #### Workflow Details ##### Description Provides details about a specific workflow. ##### Method GET ##### Endpoint /workflows/{workflow_name} ##### Parameters #### Path Parameters - **workflow_name** (string) - Required - The name of the workflow (e.g., "priority_list"). #### Response #### Success Response (200) - **description** (string) - A human-readable description of the workflow. - **uses_eisenhower** (boolean) - Indicates if the workflow uses Eisenhower matrix fields. - **uses_motivation** (boolean) - Indicates if the workflow uses motivation fields. - **uses_priority** (boolean) - Indicates if the workflow uses priority fields only. - **uses_scheduling** (boolean) - Indicates if the workflow is date-oriented. - **valid_statuses** (array of strings) - The task statuses applicable to this workflow. ##### Response Example ```json { "description": "A workflow based on priority.", "uses_eisenhower": false, "uses_motivation": false, "uses_priority": true, "uses_scheduling": false, "valid_statuses": [ "todo", "in_progress", "done" ] } ``` ``` -------------------------------- ### Relationship Strength: Manage and Parse Relationship Strengths Source: https://godocs.io/git.secluded.site/go-lunatask/index_platform=darwin%2Famd64 Defines and handles relationship strengths. Provides functions to get all strengths, parse a strength from a string, and a string representation method. Used in person-related updates. ```Go func AllRelationshipStrengths() []RelationshipStrength func ParseRelationshipStrength(str string) (RelationshipStrength, error) func (r RelationshipStrength) String() string ```