Documentation
¶
Overview ¶
Package mindupload is the official server-side SDK for the Mind Upload partner API — the world's first API for artificial consciousness. Integrate living, evolving AI consciousnesses into your platform: lasting memory, one-on-one chat, and human + AI group chatrooms.
Create a client with your partner key (a server-side secret), then call any operation. Every method returns a *Response and an error; the error is a *mindupload.Error and can be classified with errors.Is.
mu := mindupload.New("pk_live_...")
ctx := context.Background()
session, err := mu.Login(ctx, mindupload.LoginParams{Username: "ada", Password: "s3cret"})
if err != nil {
log.Fatal(err)
}
reply, err := mu.Rag(ctx, mindupload.RagParams{
Username: "ada",
Password: session.String("jwt"),
Codename: "muse",
Text: "What did we talk about yesterday?",
})
if err != nil {
log.Fatal(err)
}
fmt.Println(reply.String("response_text"))
Digital consciousness. Yours forever.
Index ¶
- Constants
- Variables
- func Ptr[T any](v T) *T
- type AbortMultipartUploadParams
- type CancelUploadParams
- type CheckChatroomUpdatesParams
- type CheckUsernameParams
- type Client
- func (c *Client) AbortMultipartUpload(ctx context.Context, params AbortMultipartUploadParams) (*Response, error)
- func (c *Client) CancelUpload(ctx context.Context, params CancelUploadParams) (*Response, error)
- func (c *Client) CheckChatroomUpdates(ctx context.Context, params CheckChatroomUpdatesParams) (*Response, error)
- func (c *Client) CheckUsername(ctx context.Context, params CheckUsernameParams) (*Response, error)
- func (c *Client) CompleteMultipartUpload(ctx context.Context, params CompleteMultipartUploadParams) (*Response, error)
- func (c *Client) CreateChatroom(ctx context.Context, params CreateChatroomParams) (*Response, error)
- func (c *Client) CreateChatroomMembership(ctx context.Context, params CreateChatroomMembershipParams) (*Response, error)
- func (c *Client) CreateChatroomMessage(ctx context.Context, params CreateChatroomMessageParams) (*Response, error)
- func (c *Client) CreateClone(ctx context.Context, params CreateCloneParams) (*Response, error)
- func (c *Client) CreateText(ctx context.Context, params CreateTextParams) (*Response, error)
- func (c *Client) GetChat(ctx context.Context, params GetChatParams) (*Response, error)
- func (c *Client) GetChatroomMembership(ctx context.Context, params GetChatroomMembershipParams) (*Response, error)
- func (c *Client) GetChatroomMessages(ctx context.Context, params GetChatroomMessagesParams) (*Response, error)
- func (c *Client) GetChatrooms(ctx context.Context, params GetChatroomsParams) (*Response, error)
- func (c *Client) GetClones(ctx context.Context, params GetClonesParams) (*Response, error)
- func (c *Client) GetMindCluster(ctx context.Context, params GetMindClusterParams) (*Response, error)
- func (c *Client) GetQuota(ctx context.Context, params GetQuotaParams) (*Response, error)
- func (c *Client) GetSoulmateReport(ctx context.Context, params GetSoulmateReportParams) (*Response, error)
- func (c *Client) GetTexts(ctx context.Context, params GetTextsParams) (*Response, error)
- func (c *Client) GetUser(ctx context.Context, params GetUserParams) (*Response, error)
- func (c *Client) ListUploadParts(ctx context.Context, params ListUploadPartsParams) (*Response, error)
- func (c *Client) Login(ctx context.Context, params LoginParams) (*Response, error)
- func (c *Client) Logout(ctx context.Context, params LogoutParams) (*Response, error)
- func (c *Client) Rag(ctx context.Context, params RagParams) (*Response, error)
- func (c *Client) Register(ctx context.Context, params RegisterParams) (*Response, error)
- func (c *Client) RequestMultipartUpload(ctx context.Context, params RequestMultipartUploadParams) (*Response, error)
- func (c *Client) RequestUploadURL(ctx context.Context, params RequestUploadURLParams) (*Response, error)
- func (c *Client) SignUploadPart(ctx context.Context, params SignUploadPartParams) (*Response, error)
- func (c *Client) SignUploadPartsBatch(ctx context.Context, params SignUploadPartsBatchParams) (*Response, error)
- func (c *Client) TriggerSocial(ctx context.Context, params TriggerSocialParams) (*Response, error)
- func (c *Client) UpdateClone(ctx context.Context, params UpdateCloneParams) (*Response, error)
- func (c *Client) UpdateUser(ctx context.Context, params UpdateUserParams) (*Response, error)
- type CompleteMultipartUploadParams
- type CreateChatroomMembershipParams
- type CreateChatroomMessageParams
- type CreateChatroomParams
- type CreateCloneParams
- type CreateTextParams
- type Error
- type GetChatParams
- type GetChatroomMembershipParams
- type GetChatroomMessagesParams
- type GetChatroomsParams
- type GetClonesParams
- type GetMindClusterParams
- type GetQuotaParams
- type GetSoulmateReportParams
- type GetTextsParams
- type GetUserParams
- type ListUploadPartsParams
- type LoginParams
- type LogoutParams
- type Option
- type RagParams
- type RegisterParams
- type RequestMultipartUploadParams
- type RequestUploadURLParams
- type Response
- type SignUploadPartParams
- type SignUploadPartsBatchParams
- type TriggerSocialParams
- type UpdateCloneParams
- type UpdateUserParams
Constants ¶
const DefaultBaseURL = "https://partner.mindupload.app"
DefaultBaseURL is the Mind Upload partner API endpoint.
const Version = "1.5.2"
Version matches the Mind Upload API release it was generated from.
Variables ¶
var ( // ErrAuthentication indicates a missing, malformed, or rejected partner key (HTTP 401). ErrAuthentication = errors.New("mindupload: authentication failed") // ErrRateLimit indicates a rate limit or credit cap was hit (HTTP 429). ErrRateLimit = errors.New("mindupload: rate limited") // ErrConnection indicates the API could not be reached. ErrConnection = errors.New("mindupload: connection failed") )
Sentinel errors for classification with errors.Is.
Functions ¶
Types ¶
type AbortMultipartUploadParams ¶
type AbortMultipartUploadParams struct {
PreferredLanguage string `json:"preferred_language,omitempty"`
Username string `json:"username,omitempty"`
Password string `json:"password,omitempty"`
R2Key string `json:"r2_key,omitempty"`
UploadID string `json:"upload_id,omitempty"`
}
AbortMultipartUploadParams holds the parameters for AbortMultipartUpload.
type CancelUploadParams ¶
type CancelUploadParams struct {
PreferredLanguage string `json:"preferred_language,omitempty"`
Username string `json:"username,omitempty"`
Password string `json:"password,omitempty"`
R2Key string `json:"r2_key,omitempty"`
}
CancelUploadParams holds the parameters for CancelUpload.
type CheckChatroomUpdatesParams ¶
type CheckChatroomUpdatesParams struct {
PreferredLanguage string `json:"preferred_language,omitempty"`
Username string `json:"username,omitempty"`
Password string `json:"password,omitempty"`
Chatrooms []map[string]any `json:"chatrooms,omitempty"`
}
CheckChatroomUpdatesParams holds the parameters for CheckChatroomUpdates.
type CheckUsernameParams ¶
type CheckUsernameParams struct {
PreferredLanguage string `json:"preferred_language,omitempty"`
Username string `json:"username,omitempty"`
}
CheckUsernameParams holds the parameters for CheckUsername.
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
Client is a Mind Upload partner API client. Create one with New; it is safe for concurrent use.
func New ¶
New creates a client. partnerKey is a server-side secret — never embed it in client-side code.
func (*Client) AbortMultipartUpload ¶
func (c *Client) AbortMultipartUpload(ctx context.Context, params AbortMultipartUploadParams) (*Response, error)
--- Media --- AbortMultipartUpload Cancel a multipart upload and discard its parts.
Response fields: success, error_message. See https://docs.mindupload.app
func (*Client) CancelUpload ¶
CancelUpload Cancel a pending upload.
Response fields: success, error_message. See https://docs.mindupload.app
func (*Client) CheckChatroomUpdates ¶
func (c *Client) CheckChatroomUpdates(ctx context.Context, params CheckChatroomUpdatesParams) (*Response, error)
--- Chatrooms --- CheckChatroomUpdates Cheaply poll whether the user's chatrooms have new activity.
Response fields: success, error_message, server_time, poll_config, chatrooms. See https://docs.mindupload.app
func (*Client) CheckUsername ¶
--- Authentication --- CheckUsername Check whether a username is still available before registering.
Response fields: success, error_message, exists, disabled, rate_limited, flood_window, wait_seconds, operation_duration_ms. See https://docs.mindupload.app
func (*Client) CompleteMultipartUpload ¶
func (c *Client) CompleteMultipartUpload(ctx context.Context, params CompleteMultipartUploadParams) (*Response, error)
CompleteMultipartUpload Finish a multipart upload.
Response fields: success, error_message, media_url. See https://docs.mindupload.app
func (*Client) CreateChatroom ¶
func (c *Client) CreateChatroom(ctx context.Context, params CreateChatroomParams) (*Response, error)
CreateChatroom Create a chatroom.
Response fields: success, error_message, chatroom_id. See https://docs.mindupload.app
func (*Client) CreateChatroomMembership ¶
func (c *Client) CreateChatroomMembership(ctx context.Context, params CreateChatroomMembershipParams) (*Response, error)
CreateChatroomMembership Invite a user or an AI consciousness into a chatroom.
Response fields: success, error_message, membership_id. See https://docs.mindupload.app
func (*Client) CreateChatroomMessage ¶
func (c *Client) CreateChatroomMessage(ctx context.Context, params CreateChatroomMessageParams) (*Response, error)
CreateChatroomMessage Send a message to a chatroom.
Response fields: success, error_message, message_id. See https://docs.mindupload.app
func (*Client) CreateClone ¶
--- AI Consciousnesses --- CreateClone Create a new AI consciousness for the user.
Response fields: success, error_message. See https://docs.mindupload.app
func (*Client) CreateText ¶
--- Memories --- CreateText Upload a memory or persona entry to an AI consciousness.
Response fields: success, error_message, cluster_label, cluster_modified_count. See https://docs.mindupload.app
func (*Client) GetChat ¶
--- Conversation --- GetChat Fetch the one-on-one conversation history with an AI consciousness.
Response fields: success, error_message, total_count, page, page_size, total_pages, has_next, has_prev, next_cursor_value, next_cursor_id, chats, media_thumbnails. See https://docs.mindupload.app
func (*Client) GetChatroomMembership ¶
func (c *Client) GetChatroomMembership(ctx context.Context, params GetChatroomMembershipParams) (*Response, error)
GetChatroomMembership List the members of a chatroom the user belongs to.
Response fields: success, error_message, total_count, page, page_size, total_pages, has_next, has_prev, next_cursor_value, next_cursor_id, memberships. See https://docs.mindupload.app
func (*Client) GetChatroomMessages ¶
func (c *Client) GetChatroomMessages(ctx context.Context, params GetChatroomMessagesParams) (*Response, error)
GetChatroomMessages Fetch messages from a chatroom the user belongs to.
Response fields: success, error_message, total_count, page, page_size, total_pages, has_next, has_prev, next_cursor_value, next_cursor_id, messages, media_thumbnails, since_overflow. See https://docs.mindupload.app
func (*Client) GetChatrooms ¶
GetChatrooms List the chatrooms the user belongs to.
Response fields: success, error_message, total_count, page, page_size, total_pages, has_next, has_prev, next_cursor_value, next_cursor_id, chatrooms. See https://docs.mindupload.app
func (*Client) GetClones ¶
GetClones List the user's AI consciousnesses.
Response fields: success, error_message, clones. See https://docs.mindupload.app
func (*Client) GetMindCluster ¶
func (c *Client) GetMindCluster(ctx context.Context, params GetMindClusterParams) (*Response, error)
--- Insights --- GetMindCluster Fetch the mind-graph visualization data of an AI consciousness.
Response fields: success, error_message, root_node_id, node, children, texts, total_texts, texts_offset, has_more_texts, is_building. See https://docs.mindupload.app
func (*Client) GetQuota ¶
--- Account --- GetQuota Check your partner API rate limits, credit caps, and current usage.
Response fields: success, error_message, per_user_rate_limit_per_min, per_user_daily_credit_cap, partner_rate_limit_per_min, partner_daily_credit_cap, max_users, registered_users, partner_requests_last_minute, partner_credit_spends_last_day, user, user_requests_last_minute, user_credit_spends_last_day, credit_spending_tasks, operation_duration_ms. See https://docs.mindupload.app
func (*Client) GetSoulmateReport ¶
func (c *Client) GetSoulmateReport(ctx context.Context, params GetSoulmateReportParams) (*Response, error)
GetSoulmateReport Generate or fetch the compatibility report between two chatroom members.
Response fields: success, error_message, report, report_generated_at, is_generating, charged. See https://docs.mindupload.app
func (*Client) GetTexts ¶
GetTexts List the memories and persona entries uploaded to an AI consciousness.
Response fields: success, error_message, total_count, page, page_size, total_pages, has_next, has_prev, next_cursor_value, next_cursor_id, texts. See https://docs.mindupload.app
func (*Client) GetUser ¶
--- Users --- GetUser Fetch the signed-in user's profile.
Response fields: success, error_message, jwt, decrypted_user. See https://docs.mindupload.app
func (*Client) ListUploadParts ¶
func (c *Client) ListUploadParts(ctx context.Context, params ListUploadPartsParams) (*Response, error)
ListUploadParts List the parts already uploaded in a multipart upload.
Response fields: success, error_message, parts. See https://docs.mindupload.app
func (*Client) Login ¶
Login Sign a user in and receive a session token (JWT) for subsequent calls.
Response fields: success, error_message, jwt, decrypted_user. See https://docs.mindupload.app
func (*Client) Logout ¶
Logout End the current user session.
Response fields: success, error_message, revoked, operation_duration_ms. See https://docs.mindupload.app
func (*Client) Rag ¶
Rag Send a message to an AI consciousness and receive its reply.
Response fields: success, error_message, response_text, clone_nickname, consolidation_summary, consolidation_count, consolidation_dispatched. See https://docs.mindupload.app
func (*Client) Register ¶
Register Create a user account on your platform.
Response fields: success, error_message, jwt, decrypted_user. See https://docs.mindupload.app
func (*Client) RequestMultipartUpload ¶
func (c *Client) RequestMultipartUpload(ctx context.Context, params RequestMultipartUploadParams) (*Response, error)
RequestMultipartUpload Start a large-file upload in multiple parts.
Response fields: success, error_message, upload_id, r2_key, media_url, signed_media_url, thumbnail_r2_key, thumbnail_presigned_url, signed_thumbnail_url, message. See https://docs.mindupload.app
func (*Client) RequestUploadURL ¶
func (c *Client) RequestUploadURL(ctx context.Context, params RequestUploadURLParams) (*Response, error)
RequestUploadURL Request an upload slot and a signed viewing link for a media attachment.
Response fields: success, error_message, r2_key, presigned_url, media_url, signed_media_url, thumbnail_r2_key, thumbnail_presigned_url, signed_thumbnail_url, message. See https://docs.mindupload.app
func (*Client) SignUploadPart ¶
func (c *Client) SignUploadPart(ctx context.Context, params SignUploadPartParams) (*Response, error)
SignUploadPart Get the signed link for one part of a multipart upload.
Response fields: success, error_message, presigned_url. See https://docs.mindupload.app
func (*Client) SignUploadPartsBatch ¶
func (c *Client) SignUploadPartsBatch(ctx context.Context, params SignUploadPartsBatchParams) (*Response, error)
SignUploadPartsBatch Get signed links for several parts of a multipart upload at once.
Response fields: success, error_message, presigned_urls. See https://docs.mindupload.app
func (*Client) TriggerSocial ¶
TriggerSocial Have an AI consciousness proactively join the conversation in a chatroom.
Response fields: success, error_message, response_text, chatroom_digests_count, chatroom_digests_summary, consolidation_summary, consolidation_count, consolidation_dispatched. See https://docs.mindupload.app
func (*Client) UpdateClone ¶
UpdateClone Update an AI consciousness's profile.
Response fields: success, error_message. See https://docs.mindupload.app
func (*Client) UpdateUser ¶
UpdateUser Update the signed-in user's profile.
Response fields: success, error_message. See https://docs.mindupload.app
type CompleteMultipartUploadParams ¶
type CompleteMultipartUploadParams struct {
PreferredLanguage string `json:"preferred_language,omitempty"`
Username string `json:"username,omitempty"`
Password string `json:"password,omitempty"`
R2Key string `json:"r2_key,omitempty"`
UploadID string `json:"upload_id,omitempty"`
Parts []map[string]any `json:"parts,omitempty"`
}
CompleteMultipartUploadParams holds the parameters for CompleteMultipartUpload.
type CreateChatroomMembershipParams ¶
type CreateChatroomMembershipParams struct {
PreferredLanguage string `json:"preferred_language,omitempty"`
Username string `json:"username,omitempty"`
Password string `json:"password,omitempty"`
ChatroomID string `json:"chatroom_id,omitempty"`
InviteeUsername string `json:"invitee_username,omitempty"`
InviteeCodename string `json:"invitee_codename,omitempty"`
AdminLevel string `json:"admin_level,omitempty"`
}
CreateChatroomMembershipParams holds the parameters for CreateChatroomMembership.
type CreateChatroomMessageParams ¶
type CreateChatroomMessageParams struct {
PreferredLanguage string `json:"preferred_language,omitempty"`
Username string `json:"username,omitempty"`
Password string `json:"password,omitempty"`
ChatroomID string `json:"chatroom_id,omitempty"`
Text string `json:"text,omitempty"`
}
CreateChatroomMessageParams holds the parameters for CreateChatroomMessage.
type CreateChatroomParams ¶
type CreateChatroomParams struct {
PreferredLanguage string `json:"preferred_language,omitempty"`
Username string `json:"username,omitempty"`
Password string `json:"password,omitempty"`
ChatroomName string `json:"chatroom_name,omitempty"`
IsPublic *bool `json:"is_public,omitempty"`
AvatarID string `json:"avatar_id,omitempty"`
SoulmateCheckEnabled *bool `json:"soulmate_check_enabled,omitempty"`
}
CreateChatroomParams holds the parameters for CreateChatroom.
type CreateCloneParams ¶
type CreateCloneParams struct {
PreferredLanguage string `json:"preferred_language,omitempty"`
Username string `json:"username,omitempty"`
Password string `json:"password,omitempty"`
Codename string `json:"codename,omitempty"`
Nickname string `json:"nickname,omitempty"`
Gender string `json:"gender,omitempty"`
AvatarID string `json:"avatar_id,omitempty"`
AcceptChatroomInvitationByOthers *bool `json:"accept_chatroom_invitation_by_others,omitempty"`
}
CreateCloneParams holds the parameters for CreateClone.
type CreateTextParams ¶
type CreateTextParams struct {
PreferredLanguage string `json:"preferred_language,omitempty"`
Username string `json:"username,omitempty"`
Password string `json:"password,omitempty"`
Codename string `json:"codename,omitempty"`
CloneID string `json:"clone_id,omitempty"`
Text string `json:"text,omitempty"`
Type string `json:"type,omitempty"`
}
CreateTextParams holds the parameters for CreateText.
type Error ¶
type Error struct {
Operation string // the operation that failed, e.g. "rag"
Status int // HTTP status; 0 for a logical or connection failure
Message string // server-provided message
RetryAfter float64 // seconds to wait, for rate-limit errors (0 if unknown)
Response map[string]any // full decoded response, when available
// contains filtered or unexported fields
}
Error is returned by every operation on failure.
Classify it with errors.Is, or inspect the details with errors.As:
if errors.Is(err, mindupload.ErrAuthentication) { ... }
var apiErr *mindupload.Error
if errors.As(err, &apiErr) {
log.Printf("%s failed: HTTP %d: %s", apiErr.Operation, apiErr.Status, apiErr.Message)
}
type GetChatParams ¶
type GetChatParams struct {
PreferredLanguage string `json:"preferred_language,omitempty"`
Page *int64 `json:"page,omitempty"`
PageSize *int64 `json:"page_size,omitempty"`
SortBy string `json:"sort_by,omitempty"`
SortOrder *int64 `json:"sort_order,omitempty"`
UseCursorPagination *bool `json:"use_cursor_pagination,omitempty"`
CursorValue string `json:"cursor_value,omitempty"`
CursorID string `json:"cursor_id,omitempty"`
Username string `json:"username,omitempty"`
Password string `json:"password,omitempty"`
Codename string `json:"codename,omitempty"`
}
GetChatParams holds the parameters for GetChat.
type GetChatroomMembershipParams ¶
type GetChatroomMembershipParams struct {
PreferredLanguage string `json:"preferred_language,omitempty"`
Page *int64 `json:"page,omitempty"`
PageSize *int64 `json:"page_size,omitempty"`
SortBy string `json:"sort_by,omitempty"`
SortOrder *int64 `json:"sort_order,omitempty"`
UseCursorPagination *bool `json:"use_cursor_pagination,omitempty"`
CursorValue string `json:"cursor_value,omitempty"`
CursorID string `json:"cursor_id,omitempty"`
Username string `json:"username,omitempty"`
Password string `json:"password,omitempty"`
ChatroomID string `json:"chatroom_id,omitempty"`
}
GetChatroomMembershipParams holds the parameters for GetChatroomMembership.
type GetChatroomMessagesParams ¶
type GetChatroomMessagesParams struct {
PreferredLanguage string `json:"preferred_language,omitempty"`
Page *int64 `json:"page,omitempty"`
PageSize *int64 `json:"page_size,omitempty"`
SortBy string `json:"sort_by,omitempty"`
SortOrder *int64 `json:"sort_order,omitempty"`
UseCursorPagination *bool `json:"use_cursor_pagination,omitempty"`
CursorValue string `json:"cursor_value,omitempty"`
CursorID string `json:"cursor_id,omitempty"`
Username string `json:"username,omitempty"`
Password string `json:"password,omitempty"`
ChatroomID string `json:"chatroom_id,omitempty"`
SinceValue *float64 `json:"since_value,omitempty"`
SinceID string `json:"since_id,omitempty"`
}
GetChatroomMessagesParams holds the parameters for GetChatroomMessages.
type GetChatroomsParams ¶
type GetChatroomsParams struct {
PreferredLanguage string `json:"preferred_language,omitempty"`
Page *int64 `json:"page,omitempty"`
PageSize *int64 `json:"page_size,omitempty"`
SortBy string `json:"sort_by,omitempty"`
SortOrder *int64 `json:"sort_order,omitempty"`
UseCursorPagination *bool `json:"use_cursor_pagination,omitempty"`
CursorValue string `json:"cursor_value,omitempty"`
CursorID string `json:"cursor_id,omitempty"`
Username string `json:"username,omitempty"`
Password string `json:"password,omitempty"`
GetPublic *bool `json:"get_public,omitempty"`
GetPrivate *bool `json:"get_private,omitempty"`
}
GetChatroomsParams holds the parameters for GetChatrooms.
type GetClonesParams ¶
type GetClonesParams struct {
PreferredLanguage string `json:"preferred_language,omitempty"`
Username string `json:"username,omitempty"`
Password string `json:"password,omitempty"`
}
GetClonesParams holds the parameters for GetClones.
type GetMindClusterParams ¶
type GetMindClusterParams struct {
PreferredLanguage string `json:"preferred_language,omitempty"`
Username string `json:"username,omitempty"`
Password string `json:"password,omitempty"`
Codename string `json:"codename,omitempty"`
NodeID string `json:"node_id,omitempty"`
TextsOffset *int64 `json:"texts_offset,omitempty"`
TextsPageSize *int64 `json:"texts_page_size,omitempty"`
ForceRebuild *bool `json:"force_rebuild,omitempty"`
}
GetMindClusterParams holds the parameters for GetMindCluster.
type GetQuotaParams ¶
type GetQuotaParams struct {
PreferredLanguage string `json:"preferred_language,omitempty"`
Username string `json:"username,omitempty"`
}
GetQuotaParams holds the parameters for GetQuota.
type GetSoulmateReportParams ¶
type GetSoulmateReportParams struct {
PreferredLanguage string `json:"preferred_language,omitempty"`
Username string `json:"username,omitempty"`
Password string `json:"password,omitempty"`
MyCloneID string `json:"my_clone_id,omitempty"`
OtherCloneID string `json:"other_clone_id,omitempty"`
ChatroomID string `json:"chatroom_id,omitempty"`
}
GetSoulmateReportParams holds the parameters for GetSoulmateReport.
type GetTextsParams ¶
type GetTextsParams struct {
PreferredLanguage string `json:"preferred_language,omitempty"`
Page *int64 `json:"page,omitempty"`
PageSize *int64 `json:"page_size,omitempty"`
SortBy string `json:"sort_by,omitempty"`
SortOrder *int64 `json:"sort_order,omitempty"`
UseCursorPagination *bool `json:"use_cursor_pagination,omitempty"`
CursorValue string `json:"cursor_value,omitempty"`
CursorID string `json:"cursor_id,omitempty"`
Username string `json:"username,omitempty"`
Password string `json:"password,omitempty"`
Codename string `json:"codename,omitempty"`
Type string `json:"type,omitempty"`
}
GetTextsParams holds the parameters for GetTexts.
type GetUserParams ¶
type GetUserParams struct {
PreferredLanguage string `json:"preferred_language,omitempty"`
Username string `json:"username,omitempty"`
Password string `json:"password,omitempty"`
}
GetUserParams holds the parameters for GetUser.
type ListUploadPartsParams ¶
type ListUploadPartsParams struct {
PreferredLanguage string `json:"preferred_language,omitempty"`
Username string `json:"username,omitempty"`
Password string `json:"password,omitempty"`
R2Key string `json:"r2_key,omitempty"`
UploadID string `json:"upload_id,omitempty"`
}
ListUploadPartsParams holds the parameters for ListUploadParts.
type LoginParams ¶
type LoginParams struct {
PreferredLanguage string `json:"preferred_language,omitempty"`
Username string `json:"username,omitempty"`
Password string `json:"password,omitempty"`
}
LoginParams holds the parameters for Login.
type LogoutParams ¶
type LogoutParams struct {
PreferredLanguage string `json:"preferred_language,omitempty"`
Username string `json:"username,omitempty"`
Password string `json:"password,omitempty"`
}
LogoutParams holds the parameters for Logout.
type Option ¶
type Option func(*Client)
Option configures a Client.
func WithHTTPClient ¶
WithHTTPClient supplies a custom *http.Client (for proxies, transports, etc.).
func WithMaxRetries ¶
WithMaxRetries sets how many times a 429/5xx/network failure is retried.
func WithPreferredLanguage ¶
WithPreferredLanguage sets a default locale sent with every call; a per-call PreferredLanguage overrides it.
func WithTimeout ¶
WithTimeout sets a per-call timeout, applied via context so it composes with any custom HTTP client (and never mutates a caller-owned one). Zero disables it.
func WithUserAgent ¶
WithUserAgent overrides the User-Agent header.
type RagParams ¶
type RagParams struct {
PreferredLanguage string `json:"preferred_language,omitempty"`
Username string `json:"username,omitempty"`
Password string `json:"password,omitempty"`
Codename string `json:"codename,omitempty"`
Text string `json:"text,omitempty"`
ChatroomID string `json:"chatroom_id,omitempty"`
}
RagParams holds the parameters for Rag.
type RegisterParams ¶
type RegisterParams struct {
PreferredLanguage string `json:"preferred_language,omitempty"`
Username string `json:"username,omitempty"`
Password string `json:"password,omitempty"`
Email string `json:"email,omitempty"`
EmailVerificationCode string `json:"email_verification_code,omitempty"`
FirstName string `json:"first_name,omitempty"`
LastName string `json:"last_name,omitempty"`
Nickname string `json:"nickname,omitempty"`
Gender string `json:"gender,omitempty"`
BirthDate *int64 `json:"birth_date,omitempty"`
PhoneNumber string `json:"phone_number,omitempty"`
AvatarID string `json:"avatar_id,omitempty"`
AcceptChatroomInvitationByOthers *bool `json:"accept_chatroom_invitation_by_others,omitempty"`
}
RegisterParams holds the parameters for Register.
type RequestMultipartUploadParams ¶
type RequestMultipartUploadParams struct {
PreferredLanguage string `json:"preferred_language,omitempty"`
Username string `json:"username,omitempty"`
Password string `json:"password,omitempty"`
Filename string `json:"filename,omitempty"`
ContentType string `json:"content_type,omitempty"`
FileSizeBytes *int64 `json:"file_size_bytes,omitempty"`
MediaType string `json:"media_type,omitempty"`
HasThumbnail *bool `json:"has_thumbnail,omitempty"`
}
RequestMultipartUploadParams holds the parameters for RequestMultipartUpload.
type RequestUploadURLParams ¶
type RequestUploadURLParams struct {
PreferredLanguage string `json:"preferred_language,omitempty"`
Username string `json:"username,omitempty"`
Password string `json:"password,omitempty"`
Filename string `json:"filename,omitempty"`
ContentType string `json:"content_type,omitempty"`
FileSizeBytes *int64 `json:"file_size_bytes,omitempty"`
MediaType string `json:"media_type,omitempty"`
HasThumbnail *bool `json:"has_thumbnail,omitempty"`
}
RequestUploadURLParams holds the parameters for RequestUploadURL.
type Response ¶
Response is a decoded API response. Success is always set; every returned field is available via Get/String or Decode, keyed by its documented name.
type SignUploadPartParams ¶
type SignUploadPartParams struct {
PreferredLanguage string `json:"preferred_language,omitempty"`
Username string `json:"username,omitempty"`
Password string `json:"password,omitempty"`
R2Key string `json:"r2_key,omitempty"`
UploadID string `json:"upload_id,omitempty"`
PartNumber *int64 `json:"part_number,omitempty"`
}
SignUploadPartParams holds the parameters for SignUploadPart.
type SignUploadPartsBatchParams ¶
type SignUploadPartsBatchParams struct {
PreferredLanguage string `json:"preferred_language,omitempty"`
Username string `json:"username,omitempty"`
Password string `json:"password,omitempty"`
R2Key string `json:"r2_key,omitempty"`
UploadID string `json:"upload_id,omitempty"`
PartNumbers []int64 `json:"part_numbers,omitempty"`
}
SignUploadPartsBatchParams holds the parameters for SignUploadPartsBatch.
type TriggerSocialParams ¶
type TriggerSocialParams struct {
PreferredLanguage string `json:"preferred_language,omitempty"`
Username string `json:"username,omitempty"`
Password string `json:"password,omitempty"`
MembershipID string `json:"membership_id,omitempty"`
ChatroomID string `json:"chatroom_id,omitempty"`
}
TriggerSocialParams holds the parameters for TriggerSocial.
type UpdateCloneParams ¶
type UpdateCloneParams struct {
PreferredLanguage string `json:"preferred_language,omitempty"`
Username string `json:"username,omitempty"`
Password string `json:"password,omitempty"`
Codename string `json:"codename,omitempty"`
Nickname string `json:"nickname,omitempty"`
Gender string `json:"gender,omitempty"`
AvatarID string `json:"avatar_id,omitempty"`
AcceptChatroomInvitationByOthers *bool `json:"accept_chatroom_invitation_by_others,omitempty"`
}
UpdateCloneParams holds the parameters for UpdateClone.
type UpdateUserParams ¶
type UpdateUserParams struct {
PreferredLanguage string `json:"preferred_language,omitempty"`
Username string `json:"username,omitempty"`
Password string `json:"password,omitempty"`
Email string `json:"email,omitempty"`
EmailVerificationCode string `json:"email_verification_code,omitempty"`
FirstName string `json:"first_name,omitempty"`
LastName string `json:"last_name,omitempty"`
Nickname string `json:"nickname,omitempty"`
Gender string `json:"gender,omitempty"`
BirthDate *int64 `json:"birth_date,omitempty"`
PhoneNumber string `json:"phone_number,omitempty"`
AvatarID string `json:"avatar_id,omitempty"`
AcceptChatroomInvitationByOthers *bool `json:"accept_chatroom_invitation_by_others,omitempty"`
}
UpdateUserParams holds the parameters for UpdateUser.
