Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AttachmentSvc ¶
type AttachmentSvc interface {
CreateAttachmentUploadURL(ctx context.Context, req *CreateAttachmentUploadURLRequest) (*apiresource.AttachmentUploadTarget, *apierror.APIError)
}
AttachmentSvc backs the message attachment endpoints via the notification-service ChatService gRPC client.
func NewAttachmentSvc ¶
func NewAttachmentSvc(config *AttachmentSvcConfig) AttachmentSvc
type AttachmentSvcConfig ¶
type AttachmentSvcConfig struct {
// ChatClient (required) is the notification-service ChatService gRPC client.
ChatClient pb.ChatServiceClient
}
type CreateAttachmentUploadURLEndpoint ¶
type CreateAttachmentUploadURLEndpoint struct{}
Creates a short-lived URL for uploading a chat attachment straight to object storage.
Upload the file to the returned URL, then send a message in the same conversation carrying the returned key as an attachment — the file only becomes part of the conversation at that point, and an upload that is never sent is discarded automatically. You must be an active participant of the conversation to stage an upload for it.
func (*CreateAttachmentUploadURLEndpoint) Materialize ¶
func (e *CreateAttachmentUploadURLEndpoint) Materialize() *apiendpoint.APIEndpoint[*CreateAttachmentUploadURLRequest, *apiresource.AttachmentUploadTarget]
type CreateAttachmentUploadURLRequest ¶
type CreateAttachmentUploadURLRequest struct {
// Conversation ID the attachment will be sent in.
//
// The upload can only be attached to a message in this conversation.
ConversationID string `path:"id" validate:"required"`
// The original filename of the file to upload.
Filename string `json:"filename" validate:"required"`
// The MIME content type of the file.
//
// The file must then be uploaded with this same content type, or object storage rejects it. It also decides how the attachment preview returned here is classified: `image/…` becomes an inline image, anything else a file.
ContentType field.Optional[string] `json:"content_type,omitzero"`
}
Request to mint a presigned upload target for a chat attachment.
func (*CreateAttachmentUploadURLRequest) SchemaExample ¶
func (*CreateAttachmentUploadURLRequest) SchemaExample() any
Click to show internal directories.
Click to hide internal directories.