Documentation
¶
Index ¶
Constants ¶
View Source
const ( StatusPending = "Pending" StatusProcessing = "Pending" StatusCompleted = "Completed" StatusFailed = "Failed" )
Variables ¶
This section is empty.
Functions ¶
Types ¶
type JobMessage ¶
type JobMessage struct {
Id string
Action string
Prompt string
MessageImageIdx int64
MessageId string
MessageHash string
Channel int64
SourceClient string
}
JobMessage is a struct that represents the mid-journey job message. It contains the following fields: - Id: ID of the mid-journey job for the database - Action: action to be taken for the mid-journey job - Prompt: the text prompt for the mid-journey job - MessageImageIdx: index of the message image for the mid-journey job - MessageId: ID of the message for the mid-journey job - MessageHash: the hash code of the message for the mid-journey job - Channel: channel for the mid-journey job, it should match the message's channel
type MidJourney ¶
type MidJourney struct {
Dao *daos.Dao
Client *midjourney.MidJourney
}
func GetDefaultClient ¶
func GetDefaultClient() *MidJourney
func New ¶
func New(dao *daos.Dao) *MidJourney
func (*MidJourney) ProcessMessage ¶
func (m *MidJourney) ProcessMessage(msg *JobMessage) (job *MjDTO, err error)
type MjDTO ¶
type MjDTO struct {
dtoutils.BaseModel
Prompt *string `json:"prompt,omitempty" db:"prompt"`
Action *string `json:"action,omitempty" db:"action"`
Status *string `json:"status,omitempty" db:"status"`
ChannelID *int64 `json:"channel_id,omitempty" db:"channel_id"`
MessageImageIdx *int64 `json:"message_image_idx,omitempty" db:"message_image_idx"`
MessageID *string `json:"message_id,omitempty" db:"message_id"`
MessageHash *string `json:"message_hash,omitempty" db:"message_hash"`
MessageContent *string `json:"message_content,omitempty" db:"message_content"`
ImageName *string `json:"image_name,omitempty" db:"image_name"`
ImageUrl *string `json:"image_url,omitempty" db:"image_url"`
ImageContentType *string `json:"image_content_type,omitempty" db:"image_content_type"`
ImageSize *int64 `json:"image_size,omitempty" db:"image_size"`
ImageHeight *int64 `json:"image_height,omitempty" db:"image_height"`
ImageWidth *int64 `json:"image_width,omitempty" db:"image_width"`
TelegramFileId *string `json:"telegram_file_id,omitempty" db:"telegram_file_id"`
}
Click to show internal directories.
Click to hide internal directories.