Documentation ¶
Overview ¶
API client for readthedocs.org.
Index ¶
- Constants
- type Client
- func (c *Client) CreateProject(ctx context.Context, createProject CreateUpdateProject) (string, error)
- func (c *Client) DeleteProject(ctx context.Context, slug string) error
- func (c *Client) GetProject(ctx context.Context, slug string) (Project, error)
- func (c *Client) GetProjects(ctx context.Context) ([]Project, error)
- func (c *Client) UpdateProject(ctx context.Context, slug string, updateProject CreateUpdateProject) error
- type CreateProject
- type CreateUpdateProject
- type Project
- type Repository
Constants ¶
View Source
const BaseURLV3 = "https://readthedocs.org/api/v3"
APIs default base URL.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Client ¶
type Client struct { BaseURL string HTTPClient *http.Client // contains filtered or unexported fields }
func NewClientWithURL ¶ added in v3.0.10
Create the API client using a custom URL, providing the authentication key.
func (*Client) CreateProject ¶
func (*Client) DeleteProject ¶ added in v3.0.3
func (*Client) GetProject ¶
func (*Client) UpdateProject ¶
type CreateProject ¶ added in v3.0.1
type CreateProject struct { Name string `json:"name"` Repository Repository `json:"repository"` Homepage string `json:"homepage,omitempty"` ProgrammingLanguage string `json:"programming_language,omitempty"` Language string `json:"language,omitempty"` Organization string `json:"organization,omitempty"` Teams string `json:"teams,omitempty"` }
type CreateUpdateProject ¶
type CreateUpdateProject struct { CreateProject DefaultVersion string `json:"default_version,omitempty"` DefaultBranch string `json:"default_branch,omitempty"` AnalyticsCode string `json:"analytics_code,omitempty"` AnalyticsDisabled bool `json:"analytics_disabled"` ShowVersionWarning bool `json:"show_version_warning"` SingleVersion bool `json:"single_version"` ExternalBuildsEnabled bool `json:"external_builds_enabled"` }
type Project ¶
type Project struct { ID int `json:"id"` Name string `json:"name"` Slug string `json:"slug"` Created time.Time `json:"created"` Modified time.Time `json:"modified"` Language struct { Code string `json:"code"` Name string `json:"name"` } `json:"language"` ProgrammingLanguage struct { Code string `json:"code"` Name string `json:"name"` } `json:"programming_language"` Repository struct { URL string `json:"url"` Type string `json:"type"` } `json:"repository"` DefaultVersion string `json:"default_version"` DefaultBranch string `json:"default_branch"` SubprojectOf string `json:"subproject_of"` TranslationOf string `json:"translation_of"` URLs struct { Documentation string `json:"documentation"` Home string `json:"home"` } `json:"urls"` Tags []string `json:"tags"` Users []struct { Username string `json:"username"` } ActiveVersions map[string]string `json:"active_versions"` }
type Repository ¶ added in v3.0.2
Directories ¶
Path | Synopsis |
---|---|
cmd
|
|
create_project
Example of creating a project
|
Example of creating a project |
read_projects
Example of listing projects
|
Example of listing projects |
Click to show internal directories.
Click to hide internal directories.