ysk

package
v0.4.7-alpha18 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 20, 2024 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DeleteCard

func DeleteCard(ctx context.Context, cardID string, publish func(context.Context, string, string, map[string]string)) error

func NewYSKCard

func NewYSKCard(ctx context.Context, YSKCard YSKCard, publish func(context.Context, string, string, map[string]string)) error

func ToCodegenYSKCard

func ToCodegenYSKCard(card YSKCard) (codegen.YSKCard, error)

Types

type ActionPosition

type ActionPosition string
const (
	ActionPositionLeft  ActionPosition = "left"
	ActionPositionRight ActionPosition = "right"
)

type CartType

type CartType string
const (
	CardTypeTask      CartType = "task"
	CardTypeLongNote  CartType = "long-notice"
	CardTypeShortNote CartType = "short-notice"
)

type RenderType

type RenderType string
const (
	RenderTypeCardTask           RenderType = "task"
	RenderTypeCardListNotice     RenderType = "list-notice"
	RenderTypeCardIconTextNotice RenderType = "icon-text-notice"
	RenderTypeCardMarkdownNotice RenderType = "markdown-notice"
)

type YSKCard

type YSKCard struct {
	Id         string         `json:"id"`
	CardType   CartType       `json:"cardType"`
	RenderType RenderType     `json:"renderType"`
	Content    YSKCardContent `json:"content"`
}

func DefineCard

func DefineCard(ctx context.Context, cardID string) YSKCard

func FromCodegenYSKCard

func FromCodegenYSKCard(card codegen.YSKCard) (YSKCard, error)

func (YSKCard) UpsertFooterAction

func (YSKCard YSKCard) UpsertFooterAction(action YSKCardFooterAction) YSKCard

it will replace the old action by same side and style

func (YSKCard) WithFooterActions

func (yskCard YSKCard) WithFooterActions(actions []YSKCardFooterAction) YSKCard

replace the all old action

func (YSKCard) WithIconText

func (yskCard YSKCard) WithIconText(icon YSKCardIcon, description string) YSKCard

func (YSKCard) WithId

func (ysk YSKCard) WithId(id string) YSKCard

func (YSKCard) WithList

func (yskCard YSKCard) WithList(params []YSKCardListItem) YSKCard

func (YSKCard) WithProgress

func (yskCard YSKCard) WithProgress(label string, progress int) YSKCard

func (YSKCard) WithTaskContent

func (ysk YSKCard) WithTaskContent(TitleIcon YSKCardIcon, TitleText string) YSKCard

type YSKCardContent

type YSKCardContent struct {
	TitleIcon        YSKCardIcon           `json:"titleIcon" gorm:"column:title_icon"`
	TitleText        string                `json:"titleText" gorm:"column:title_text"`
	BodyProgress     *YSKCardProgress      `json:"bodyProgress,omitempty" gorm:"serializer:json"`
	BodyIconWithText *YSKCardIconWithText  `json:"bodyIconWithText,omitempty" gorm:"serializer:json"`
	BodyList         []YSKCardListItem     `json:"bodyList,omitempty" gorm:"serializer:json"`
	FooterActions    []YSKCardFooterAction `json:"footerActions,omitempty" gorm:"serializer:json"`
}

func (*YSKCardContent) Scan

func (p *YSKCardContent) Scan(value interface{}) error

func (YSKCardContent) Value

func (p YSKCardContent) Value() (driver.Value, error)

type YSKCardFooterAction

type YSKCardFooterAction struct {
	Side       ActionPosition          `json:"side"`
	Style      string                  `json:"style"`
	Text       string                  `json:"text"`
	MessageBus YSKCardMessageBusAction `json:"messageBus"`
}

type YSKCardIcon

type YSKCardIcon string
const (
	FileIcon     YSKCardIcon = "/modules/icewhale_files/appicon.svg"
	DiskIcon     YSKCardIcon = "/src/assets/img/storage/disk.png"
	ZimaIcon     YSKCardIcon = "/src/assets/img/zima.svg"
	StorageIcon  YSKCardIcon = "/src/assets/img/storage/storage.svg"
	AppStoreIcon YSKCardIcon = "/src/assets/img/welcome/appstore.svg"
)

type YSKCardIconWithText

type YSKCardIconWithText struct {
	Icon        YSKCardIcon `json:"icon"`
	Description string      `json:"description"`
}

type YSKCardListItem

type YSKCardListItem struct {
	Icon        YSKCardIcon `json:"icon"`
	Description string      `json:"description"`
	RightText   string      `json:"rightText"`
}

type YSKCardMessageBusAction

type YSKCardMessageBusAction struct {
	Key     string `json:"key"`
	Payload string `json:"payload"`
}

type YSKCardProgress

type YSKCardProgress struct {
	Label    string `json:"label"`
	Progress int    `json:"progress"`
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL