ysk

package
v0.4.7-alpha6 Latest Latest
Warning

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

Go to latest
Published: Aug 6, 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) WithProgress

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

type YSKCardContent

type YSKCardContent struct {
	TitleIcon        string                `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
	Style      string
	Text       string
	MessageBus YSKCardMessageBusAction
}

type YSKCardIcon

type YSKCardIcon = string

type YSKCardIconWithText

type YSKCardIconWithText struct {
	Icon        string
	Description string
}

type YSKCardListItem

type YSKCardListItem struct {
	Icon        string
	Description string
	RightText   string
}

type YSKCardMessageBusAction

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

type YSKCardProgress

type YSKCardProgress struct {
	Label    string
	Progress int
}

Jump to

Keyboard shortcuts

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