Documentation
¶
Index ¶
- func IsTemporary(err error) bool
- type Attachment
- type AttachmentCreateClient
- type AttachmentData
- type AttachmentsClient
- type Client
- type Collection
- type CollectionID
- type CollectionsClient
- func (cl *CollectionsClient) Create(name string) *CollectionsCreateClient
- func (cl *CollectionsClient) DocumentStructure(id CollectionID) *CollectionsDocumentStructureClient
- func (cl *CollectionsClient) Get(id CollectionID) *CollectionsGetClient
- func (cl *CollectionsClient) List() *CollectionsListClient
- type CollectionsCreateClient
- func (cl *CollectionsCreateClient) Color(color string) *CollectionsCreateClient
- func (cl *CollectionsCreateClient) Description(desc string) *CollectionsCreateClient
- func (cl *CollectionsCreateClient) Do(ctx context.Context) (*Collection, error)
- func (cl *CollectionsCreateClient) PermissionRead() *CollectionsCreateClient
- func (cl *CollectionsCreateClient) PermissionReadWrite() *CollectionsCreateClient
- func (cl *CollectionsCreateClient) Private(private bool) *CollectionsCreateClient
- type CollectionsDocumentStructureClient
- type CollectionsGetClient
- type CollectionsListClient
- type CollectionsListFn
- type Document
- type DocumentID
- type DocumentShareID
- type DocumentStructure
- type DocumentSummary
- type DocumentUrlID
- type DocumentsClient
- type DocumentsClientGet
- type DocumentsClientGetAll
- type DocumentsCreateClient
- func (cl *DocumentsCreateClient) Do(ctx context.Context) (*Document, error)
- func (cl *DocumentsCreateClient) ParentDocumentID(id DocumentID) *DocumentsCreateClient
- func (cl *DocumentsCreateClient) Publish(publish bool) *DocumentsCreateClient
- func (cl *DocumentsCreateClient) Template(template bool) *DocumentsCreateClient
- func (cl *DocumentsCreateClient) TemplateID(id TemplateID) *DocumentsCreateClient
- func (cl *DocumentsCreateClient) Text(text string) *DocumentsCreateClient
- type DocumentsUpdateClient
- func (cl *DocumentsUpdateClient) Append(append bool) *DocumentsUpdateClient
- func (cl *DocumentsUpdateClient) Do(ctx context.Context) (*Document, error)
- func (cl *DocumentsUpdateClient) Done(done bool) *DocumentsUpdateClient
- func (cl *DocumentsUpdateClient) Publish(publish bool) *DocumentsUpdateClient
- func (cl *DocumentsUpdateClient) Text(text string) *DocumentsUpdateClient
- func (cl *DocumentsUpdateClient) Title(title string) *DocumentsUpdateClient
- type TemplateID
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func IsTemporary ¶
IsTemporary returns true if err is temporary in nature i.e. you can retry the same operation in some time. This would usually return true for server side errors.
Types ¶
type Attachment ¶ added in v0.4.0
type Attachment struct { MaxUploadSize int `json:"maxUploadSize"` UploadURL string `json:"uploadUrl"` Form map[string]interface{} `json:"form"` AttachmentData AttachmentData `json:"attachment"` }
type AttachmentCreateClient ¶ added in v0.4.0
type AttachmentCreateClient struct {
// contains filtered or unexported fields
}
AttachmentCreateClient is a client for creating a single attachment.
func (*AttachmentCreateClient) Do ¶ added in v0.4.0
func (cl *AttachmentCreateClient) Do(ctx context.Context) (*Attachment, error)
Do makes the actual request to create a attachment.
func (*AttachmentCreateClient) DocumentID ¶ added in v0.4.0
func (cl *AttachmentCreateClient) DocumentID(id DocumentID) *AttachmentCreateClient
type AttachmentData ¶ added in v0.4.0
type AttachmentsClient ¶ added in v0.4.0
type AttachmentsClient struct {
// contains filtered or unexported fields
}
AttachmentsClient exposes CRUD operations around the attachments resource.
func (*AttachmentsClient) Create ¶ added in v0.4.0
func (cl *AttachmentsClient) Create(name string, contentType string, size int) *AttachmentCreateClient
Create returns a client for creating a single attachment in the specified collection. API reference: https://www.getoutline.com/developers#tag/Attachments/paths/~1attachments.create/post
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
Client is per server top level client which acts as entry point and stores common configuration (like base url) for resource level clients. It is preferred to reuse same client while communicating to the same server as this makes better utilization of resources.
func (*Client) Attachments ¶ added in v0.4.0
func (cl *Client) Attachments() *AttachmentsClient
Attachments creates a client for operating on attachments.
func (*Client) Collections ¶
func (cl *Client) Collections() *CollectionsClient
Collections creates a client for operating on collections.
func (*Client) Documents ¶
func (cl *Client) Documents() *DocumentsClient
Documents creates a client for operating on documents.
type Collection ¶
type Collection struct { ID CollectionID `json:"id"` Name string `json:"name"` Description string `json:"description"` Sort map[string]any `json:"sort"` Index string `json:"index"` Color string `json:"color"` Icon string `json:"icon"` Permission string `json:"permission"` CreatedAt time.Time `json:"createdAt"` UpdatedAt time.Time `json:"updatedAt"` DeletedAt time.Time `json:"deletedAt"` }
Collection represents an outline collection.
type CollectionID ¶
type CollectionID string
type CollectionsClient ¶
type CollectionsClient struct {
// contains filtered or unexported fields
}
CollectionsClient exposes CRUD operations around the collections resource.
func (*CollectionsClient) Create ¶
func (cl *CollectionsClient) Create(name string) *CollectionsCreateClient
Create returns a client for creating a collection. API reference: https://www.getoutline.com/developers#tag/Collections/paths/~1collections.create/post
func (*CollectionsClient) DocumentStructure ¶
func (cl *CollectionsClient) DocumentStructure(id CollectionID) *CollectionsDocumentStructureClient
DocumentStructure gives access to id's document structure. API Reference: https://www.getoutline.com/developers#tag/Collections/paths/~1collections.documents/post
func (*CollectionsClient) Get ¶
func (cl *CollectionsClient) Get(id CollectionID) *CollectionsGetClient
func (*CollectionsClient) List ¶
func (cl *CollectionsClient) List() *CollectionsListClient
type CollectionsCreateClient ¶
type CollectionsCreateClient struct {
// contains filtered or unexported fields
}
func (*CollectionsCreateClient) Color ¶
func (cl *CollectionsCreateClient) Color(color string) *CollectionsCreateClient
func (*CollectionsCreateClient) Description ¶
func (cl *CollectionsCreateClient) Description(desc string) *CollectionsCreateClient
func (*CollectionsCreateClient) Do ¶
func (cl *CollectionsCreateClient) Do(ctx context.Context) (*Collection, error)
Do make the actual request to create a collection.
func (*CollectionsCreateClient) PermissionRead ¶
func (cl *CollectionsCreateClient) PermissionRead() *CollectionsCreateClient
func (*CollectionsCreateClient) PermissionReadWrite ¶
func (cl *CollectionsCreateClient) PermissionReadWrite() *CollectionsCreateClient
func (*CollectionsCreateClient) Private ¶
func (cl *CollectionsCreateClient) Private(private bool) *CollectionsCreateClient
type CollectionsDocumentStructureClient ¶
type CollectionsDocumentStructureClient struct {
// contains filtered or unexported fields
}
func (*CollectionsDocumentStructureClient) Do ¶
func (cl *CollectionsDocumentStructureClient) Do(ctx context.Context) (DocumentStructure, error)
Do makes the actual request for getting the collection's document structure.
type CollectionsGetClient ¶
type CollectionsGetClient struct {
// contains filtered or unexported fields
}
func (*CollectionsGetClient) Do ¶
func (cl *CollectionsGetClient) Do(ctx context.Context) (*Collection, error)
Do makes the actual request for fetching said collection info.
type CollectionsListClient ¶
type CollectionsListClient struct {
// contains filtered or unexported fields
}
func (*CollectionsListClient) Do ¶
func (cl *CollectionsListClient) Do(ctx context.Context, fn CollectionsListFn) error
Do makes the actual request for listing all collections. If the request is successful then fn is called sequentially with every collection received. But if there is some error/bad response then fn is called with the error. If fn returns false then the whole process is aborted otherwise the request is retried. NOTE: Policies if any returned are ignored as of now. Later if we find them important then we can include them too.
type CollectionsListFn ¶
type CollectionsListFn func(*Collection, error) (bool, error)
CollectionsListFn is the type of function called by CollectionsListClient.Do for every new collection it finds.
type Document ¶
type Document struct { ID DocumentID `json:"id"` CollectionID CollectionID `json:"collectionId"` ParentDocumentID DocumentID `json:"parentDocumentId"` Title string `json:"title"` FullWidth bool `json:"fullWidth"` Emoji string `json:"emoji"` Text string `json:"text"` URLID string `json:"urlId"` Collaborators []interface{} `json:"collaborators"` Pinned bool `json:"pinned"` Template bool `json:"template"` TemplateID TemplateID `json:"templateId"` Revision int `json:"revision"` CreatedAt time.Time `json:"createdAt"` CreatedBy interface{} `json:"createdBy"` UpdatedAt time.Time `json:"updatedAt"` UpdatedBy interface{} `json:"updatedBy"` PublishedAt time.Time `json:"publishedAt"` ArchivedAt time.Time `json:"archivedAt"` DeletedAt time.Time `json:"deletedAt"` }
Document represents an outline document.
type DocumentID ¶
type DocumentID string
type DocumentShareID ¶
type DocumentShareID string
type DocumentStructure ¶
type DocumentStructure []DocumentSummary
type DocumentSummary ¶
type DocumentSummary struct { ID DocumentID `json:"id"` Title string `json:"title"` URL string `json:"url"` Children []DocumentSummary `json:"children"` }
DocumentSummary represents summary of a document (and its children) that is part of a collection.
type DocumentUrlID ¶
type DocumentUrlID string
type DocumentsClient ¶
type DocumentsClient struct {
// contains filtered or unexported fields
}
DocumentsClient exposes CRUD operations around the documents resource.
func (*DocumentsClient) Create ¶
func (cl *DocumentsClient) Create(title string, id CollectionID) *DocumentsCreateClient
Create returns a client for creating a single document in the specified collection. API reference: https://www.getoutline.com/developers#tag/Documents/paths/~1documents.create/post
func (*DocumentsClient) Get ¶
func (cl *DocumentsClient) Get() *DocumentsClientGet
Get returns a client for retrieving a single document.
func (*DocumentsClient) GetAll ¶
func (cl *DocumentsClient) GetAll() *DocumentsClientGetAll
GetAll returns a client for retrieving multiple documents at once.
func (*DocumentsClient) Update ¶ added in v0.2.0
func (cl *DocumentsClient) Update(id DocumentID) *DocumentsUpdateClient
Update returns a client for updating a single document in the specified collection. API reference: https://www.getoutline.com/developers#tag/Documents/paths/~1documents.update/post
type DocumentsClientGet ¶
type DocumentsClientGet struct {
// contains filtered or unexported fields
}
DocumentsClientGet gets a single document.
func (*DocumentsClientGet) ByID ¶
func (cl *DocumentsClientGet) ByID(id DocumentID) *DocumentsClientGet
ByID configures that document be retrieved by its id.
func (*DocumentsClientGet) ByShareID ¶
func (cl *DocumentsClientGet) ByShareID(id DocumentShareID) *DocumentsClientGet
ByShareID configures that document be retrieved by its share id.
type DocumentsClientGetAll ¶
type DocumentsClientGetAll struct{}
DocumentsClientGetAll can be used to retrieve more than one document. Use available configuration options to select the documents you want to retrieve then finally call DocumentsClientGetAll.Do.
func (*DocumentsClientGetAll) Collection ¶
func (cl *DocumentsClientGetAll) Collection(id CollectionID) *DocumentsClientGetAll
Collection selects documents belonging to the collection identified by id.
func (*DocumentsClientGetAll) Do ¶
Do makes the actual request and retrieves selected documents. The user provided callback fn is called for every such document. If there is any error during the process then fn is given the error so that it can decide whether to continue or not. The callback can return false in case it wants to abort getting documents.
func (*DocumentsClientGetAll) Parent ¶
func (cl *DocumentsClientGetAll) Parent(id DocumentID) *DocumentsClientGetAll
Parent selects documents having the parent document identified by id.
type DocumentsCreateClient ¶
type DocumentsCreateClient struct {
// contains filtered or unexported fields
}
DocumentsCreateClient is a client for creating a single document.
func (*DocumentsCreateClient) Do ¶
func (cl *DocumentsCreateClient) Do(ctx context.Context) (*Document, error)
Do makes the actual request to create a document.
func (*DocumentsCreateClient) ParentDocumentID ¶
func (cl *DocumentsCreateClient) ParentDocumentID(id DocumentID) *DocumentsCreateClient
func (*DocumentsCreateClient) Publish ¶
func (cl *DocumentsCreateClient) Publish(publish bool) *DocumentsCreateClient
func (*DocumentsCreateClient) Template ¶
func (cl *DocumentsCreateClient) Template(template bool) *DocumentsCreateClient
func (*DocumentsCreateClient) TemplateID ¶
func (cl *DocumentsCreateClient) TemplateID(id TemplateID) *DocumentsCreateClient
func (*DocumentsCreateClient) Text ¶
func (cl *DocumentsCreateClient) Text(text string) *DocumentsCreateClient
type DocumentsUpdateClient ¶ added in v0.2.0
type DocumentsUpdateClient struct {
// contains filtered or unexported fields
}
DocumentsUpdateClient is a client for updating a single document.
func (*DocumentsUpdateClient) Append ¶ added in v0.2.0
func (cl *DocumentsUpdateClient) Append(append bool) *DocumentsUpdateClient
func (*DocumentsUpdateClient) Do ¶ added in v0.2.0
func (cl *DocumentsUpdateClient) Do(ctx context.Context) (*Document, error)
Do makes the actual request to update a document.
func (*DocumentsUpdateClient) Done ¶ added in v0.2.0
func (cl *DocumentsUpdateClient) Done(done bool) *DocumentsUpdateClient
func (*DocumentsUpdateClient) Publish ¶ added in v0.2.0
func (cl *DocumentsUpdateClient) Publish(publish bool) *DocumentsUpdateClient
func (*DocumentsUpdateClient) Text ¶ added in v0.2.0
func (cl *DocumentsUpdateClient) Text(text string) *DocumentsUpdateClient
func (*DocumentsUpdateClient) Title ¶ added in v0.2.0
func (cl *DocumentsUpdateClient) Title(title string) *DocumentsUpdateClient
type TemplateID ¶
type TemplateID string