Documentation ¶
Index ¶
- Constants
- func PluginDCDataExplorerQueryResultUnmarshal[T any](ctx context.Context, res *PluginDCDataExplorerQueryResult) ([]T, error)
- type Archetype
- type Category
- type CategoryList
- type CategoryListResult
- type Client
- type ConnectClient
- type GetTopicOptions
- type IdentifiedClient
- func (c *IdentifiedClient) AdminAnonymizeUser(ctx context.Context, userID int) error
- func (c *IdentifiedClient) AdminGetUserByID(ctx context.Context, userID int) (res *User, err error)
- func (c *IdentifiedClient) CreatePost(ctx context.Context, req *PostNew) (res *Post, err error)
- func (c *IdentifiedClient) GetPostByID(ctx context.Context, postID int) (res *Post, err error)
- func (c *IdentifiedClient) GetTopic(ctx context.Context, topicID int, options *GetTopicOptions) (res *TopicResult, err error)
- func (c *IdentifiedClient) GetUserByExternalID(ctx context.Context, externalID string) (res *UserResult, err error)
- func (c *IdentifiedClient) GetUserByUsername(ctx context.Context, username string) (res *UserResult, err error)
- func (c *IdentifiedClient) ListCategories(ctx context.Context, options *ListCategoriesOptions) (res *CategoryListResult, err error)
- func (c *IdentifiedClient) ListTopicPostIDs(ctx context.Context, topicID int, options *ListTopicPostIDsOptions) (res *PostIDsResult, err error)
- func (c *IdentifiedClient) ListTopicPostsByIDs(ctx context.Context, topicID int, postIDs []int) (res *PostStreamResult, err error)
- func (c *IdentifiedClient) PluginDCDataExplorerRunQuery(ctx context.Context, queryID int, options *PluginDCDataExplorerRunQueryOptions) (res *PluginDCDataExplorerQueryResult, err error)
- func (c *IdentifiedClient) PluginDCReactionsToggleReaction(ctx context.Context, postID int, reactionID string) (res *Post, err error)
- type ListCategoriesOptions
- type ListTopicPostIDsOptions
- type PluginDCDataExplorerQueryResult
- type PluginDCDataExplorerRunQueryOptions
- type PluginDCReactionsPostReaction
- type PluginDCReactionsPostReactionCurrentUser
- type PluginDCReactionsReactionType
- type Post
- type PostIDsResult
- type PostNew
- type PostStream
- type PostStreamResult
- type PostType
- type Topic
- type TopicCreatedBy
- type TopicDetails
- type TopicResult
- type User
- type UserResult
- type UserSingleSignOnRecord
Constants ¶
View Source
const ErrEmptyParam = merr.Code("empty_param")
Variables ¶
This section is empty.
Functions ¶
func PluginDCDataExplorerQueryResultUnmarshal ¶
func PluginDCDataExplorerQueryResultUnmarshal[T any](ctx context.Context, res *PluginDCDataExplorerQueryResult) ([]T, error)
Types ¶
type CategoryList ¶
type CategoryList struct {
Categories []Category `json:"categories"`
}
type CategoryListResult ¶
type CategoryListResult struct {
CategoryList CategoryList `json:"category_list"`
}
type Client ¶
func (*Client) AsSystem ¶
func (c *Client) AsSystem() *IdentifiedClient
func (*Client) AsUsername ¶
func (c *Client) AsUsername(username string) *IdentifiedClient
type ConnectClient ¶
type ConnectClient struct {
// contains filtered or unexported fields
}
func NewConnectClient ¶
func NewConnectClient(client *Client, connectSecret string) *ConnectClient
func (*ConnectClient) ParseAndVerify ¶
func (*ConnectClient) StringifyAndSign ¶
func (c *ConnectClient) StringifyAndSign(params url.Values) (sso, sig string)
type GetTopicOptions ¶
type GetTopicOptions struct {
Print bool
}
type IdentifiedClient ¶
type IdentifiedClient struct {
// contains filtered or unexported fields
}
func (*IdentifiedClient) AdminAnonymizeUser ¶
func (c *IdentifiedClient) AdminAnonymizeUser(ctx context.Context, userID int) error
func (*IdentifiedClient) AdminGetUserByID ¶
func (*IdentifiedClient) CreatePost ¶
func (*IdentifiedClient) GetPostByID ¶
func (*IdentifiedClient) GetTopic ¶
func (c *IdentifiedClient) GetTopic(ctx context.Context, topicID int, options *GetTopicOptions) (res *TopicResult, err error)
func (*IdentifiedClient) GetUserByExternalID ¶
func (c *IdentifiedClient) GetUserByExternalID(ctx context.Context, externalID string) (res *UserResult, err error)
func (*IdentifiedClient) GetUserByUsername ¶
func (c *IdentifiedClient) GetUserByUsername(ctx context.Context, username string) (res *UserResult, err error)
func (*IdentifiedClient) ListCategories ¶
func (c *IdentifiedClient) ListCategories(ctx context.Context, options *ListCategoriesOptions) (res *CategoryListResult, err error)
func (*IdentifiedClient) ListTopicPostIDs ¶
func (c *IdentifiedClient) ListTopicPostIDs(ctx context.Context, topicID int, options *ListTopicPostIDsOptions) (res *PostIDsResult, err error)
func (*IdentifiedClient) ListTopicPostsByIDs ¶
func (c *IdentifiedClient) ListTopicPostsByIDs(ctx context.Context, topicID int, postIDs []int) (res *PostStreamResult, err error)
func (*IdentifiedClient) PluginDCDataExplorerRunQuery ¶
func (c *IdentifiedClient) PluginDCDataExplorerRunQuery(ctx context.Context, queryID int, options *PluginDCDataExplorerRunQueryOptions) (res *PluginDCDataExplorerQueryResult, err error)
func (*IdentifiedClient) PluginDCReactionsToggleReaction ¶
type ListCategoriesOptions ¶
type ListCategoriesOptions struct {
IncludeSubcategories bool
}
type ListTopicPostIDsOptions ¶
type ListTopicPostIDsOptions struct {
PostNumber int
}
type PluginDCDataExplorerQueryResult ¶
type PluginDCDataExplorerQueryResult struct { // Errors indicates what went wrong with the query. // // At the time of writing, it is always empty when the request is successful. // // https://github.com/discourse/discourse-data-explorer/blob/2f1044820c479424d29d94df389360b1d9dee871/app/controllers/discourse_data_explorer/query_controller.rb#L193 Errors []string `json:"errors"` Duration float64 `json:"duration"` ResultCount int `json:"result_count"` Params map[string]any `json:"params"` Columns []string `json:"columns"` DefaultLimit int `json:"default_limit"` Explain *string `json:"explain"` Relations map[string][]map[string]any `json:"relations"` ColRender map[string]string `json:"colrender"` Rows [][]any `json:"rows"` }
type PluginDCReactionsPostReaction ¶
type PluginDCReactionsPostReaction struct { ID string `json:"id"` Type PluginDCReactionsReactionType `json:"type"` Count int `json:"count"` }
type PluginDCReactionsPostReactionCurrentUser ¶
type PluginDCReactionsPostReactionCurrentUser struct { ID string `json:"id"` Type PluginDCReactionsReactionType `json:"type"` }
type PluginDCReactionsReactionType ¶
type PluginDCReactionsReactionType string
const (
PluginDCReactionsReactionTypeEmoji PluginDCReactionsReactionType = "emoji"
)
type Post ¶
type Post struct { ID int `json:"id"` Username string `json:"username"` AvatarTemplate string `json:"avatar_template"` CreatedAt time.Time `json:"created_at"` Raw string `json:"raw"` Cooked string `json:"cooked"` PostNumber int `json:"post_number"` PostType PostType `json:"post_type"` UpdatedAt time.Time `json:"updated_at"` ReplyToPostNumber *int `json:"reply_to_post_number"` TopicID int `json:"topic_id"` Version int `json:"version"` UserID int `json:"user_id"` Hidden bool `json:"hidden"` DeletedAt *time.Time `json:"deleted_at"` Wiki bool `json:"wiki"` // Discourse Reactions plugin Reactions []PluginDCReactionsPostReaction `json:"reactions"` CurrentUserReaction *PluginDCReactionsPostReactionCurrentUser `json:"current_user_reaction"` }
type PostIDsResult ¶
type PostIDsResult struct {
PostIDs []int `json:"post_ids"`
}
type PostStream ¶
type PostStreamResult ¶
type PostStreamResult struct {
PostStream PostStream `json:"post_stream"`
}
type Topic ¶
type Topic struct { ID int `json:"id"` Title string `json:"title"` FancyTitle string `json:"fancy_title"` Slug string `json:"slug"` PostsCount int `json:"posts_count"` ReplyCount int `json:"reply_count"` HighestPostNumber int `json:"highest_post_number"` ImageURL *string `json:"image_url"` CreatedAt time.Time `json:"created_at"` LastPostedAt *time.Time `json:"last_posted_at"` Archetype Archetype `json:"archetype"` Pinned bool `json:"pinned"` Unpinned *time.Time `json:"unpinned"` Visible bool `json:"visible"` Closed bool `json:"closed"` Archived bool `json:"archived"` Tags []string `json:"tags"` CategoryID int `json:"category_id"` PinnedGlobally bool `json:"pinned_globally"` FeaturedLink *string `json:"featured_link"` Details TopicDetails `json:"details"` }
type TopicCreatedBy ¶
type TopicDetails ¶
type TopicDetails struct {
CreatedBy TopicCreatedBy `json:"created_by"`
}
type TopicResult ¶
type TopicResult struct { PostStreamResult Topic UserID int `json:"user_id"` }
type User ¶
type User struct { ID int `json:"id"` Username string `json:"username"` AvatarTemplate *string `json:"avatar_template"` SingleSignOnRecord *UserSingleSignOnRecord `json:"single_sign_on_record"` }
type UserResult ¶
type UserResult struct {
User User `json:"user"`
}
type UserSingleSignOnRecord ¶
type UserSingleSignOnRecord struct {
ExternalID string `json:"external_id"`
}
Click to show internal directories.
Click to hide internal directories.