sv_label

package
v0.6.0 Latest Latest
Warning

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

Go to latest
Published: Nov 27, 2021 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

View Source
const (
	Color_000000 = "#000000"
	Color_434343 = "#434343"
	Color_666666 = "#666666"
	Color_999999 = "#999999"
	Color_cccccc = "#cccccc"
	Color_efefef = "#efefef"
	Color_f3f3f3 = "#f3f3f3"
	Color_ffffff = "#ffffff"
	Color_fb4c2f = "#fb4c2f"
	Color_ffad47 = "#ffad47"
	Color_fad165 = "#fad165"
	Color_16a766 = "#16a766"
	Color_43d692 = "#43d692"
	Color_4a86e8 = "#4a86e8"
	Color_a479e2 = "#a479e2"
	Color_f691b3 = "#f691b3"
	Color_f6c5be = "#f6c5be"
	Color_ffe6c7 = "#ffe6c7"
	Color_fef1d1 = "#fef1d1"
	Color_b9e4d0 = "#b9e4d0"
	Color_c6f3de = "#c6f3de"
	Color_c9daf8 = "#c9daf8"
	Color_e4d7f5 = "#e4d7f5"
	Color_fcdee8 = "#fcdee8"
	Color_efa093 = "#efa093"
	Color_ffd6a2 = "#ffd6a2"
	Color_fce8b3 = "#fce8b3"
	Color_89d3b2 = "#89d3b2"
	Color_a0eac9 = "#a0eac9"
	Color_a4c2f4 = "#a4c2f4"
	Color_d0bcf1 = "#d0bcf1"
	Color_fbc8d9 = "#fbc8d9"
	Color_e66550 = "#e66550"
	Color_ffbc6b = "#ffbc6b"
	Color_fcda83 = "#fcda83"
	Color_44b984 = "#44b984"
	Color_68dfa9 = "#68dfa9"
	Color_6d9eeb = "#6d9eeb"
	Color_b694e8 = "#b694e8"
	Color_f7a7c0 = "#f7a7c0"
	Color_cc3a21 = "#cc3a21"
	Color_eaa041 = "#eaa041"
	Color_f2c960 = "#f2c960"
	Color_149e60 = "#149e60"
	Color_3dc789 = "#3dc789"
	Color_3c78d8 = "#3c78d8"
	Color_8e63ce = "#8e63ce"
	Color_e07798 = "#e07798"
	Color_ac2b16 = "#ac2b16"
	Color_cf8933 = "#cf8933"
	Color_d5ae49 = "#d5ae49"
	Color_0b804b = "#0b804b"
	Color_2a9c68 = "#2a9c68"
	Color_285bac = "#285bac"
	Color_653e9b = "#653e9b"
	Color_b65775 = "#b65775"
	Color_822111 = "#822111"
	Color_a46a21 = "#a46a21"
	Color_aa8831 = "#aa8831"
	Color_076239 = "#076239"
	Color_1a764d = "#1a764d"
	Color_1c4587 = "#1c4587"
	Color_41236d = "#41236d"
	Color_83334c = "#83334c"
	Color_464646 = "#464646"
	Color_e7e7e7 = "#e7e7e7"
	Color_0d3472 = "#0d3472"
	Color_b6cff5 = "#b6cff5"
	Color_0d3b44 = "#0d3b44"
	Color_98d7e4 = "#98d7e4"
	Color_3d188e = "#3d188e"
	Color_e3d7ff = "#e3d7ff"
	Color_711a36 = "#711a36"
	Color_fbd3e0 = "#fbd3e0"
	Color_8a1c0a = "#8a1c0a"
	Color_f2b2a8 = "#f2b2a8"
	Color_7a2e0b = "#7a2e0b"
	Color_ffc8af = "#ffc8af"
	Color_7a4706 = "#7a4706"
	Color_ffdeb5 = "#ffdeb5"
	Color_594c05 = "#594c05"
	Color_fbe983 = "#fbe983"
	Color_684e07 = "#684e07"
	Color_fdedc1 = "#fdedc1"
	Color_0b4f30 = "#0b4f30"
	Color_b3efd3 = "#b3efd3"
	Color_04502e = "#04502e"
	Color_a2dcc1 = "#a2dcc1"
	Color_c2c2c2 = "#c2c2c2"
	Color_4986e7 = "#4986e7"
	Color_2da2bb = "#2da2bb"
	Color_b99aff = "#b99aff"
	Color_994a64 = "#994a64"
	Color_f691b2 = "#f691b2"
	Color_ff7537 = "#ff7537"
	Color_ffad46 = "#ffad46"
	Color_662e37 = "#662e37"
	Color_ebdbde = "#ebdbde"
	Color_cca6ac = "#cca6ac"
	Color_094228 = "#094228"
	Color_42d692 = "#42d692"
	Color_16a765 = "#16a765"
)
View Source
const (
	VisibilityLabelListHide         = "labelHide"
	VisibilityLabelListShow         = "labelShow"
	VisibilityLabelListShowIfUnread = "labelShowIfUnread"
	VisibilityMessageListHide       = "hide"
	VisibilityMessageListShow       = "show"
)

Variables

View Source
var (
	ErrorLabelNotFound = errors.New("label not found")
)
View Source
var (
	MFindLabel = app_msg.Apply(&MsgFindLabel{}).(*MsgFindLabel)
)
View Source
var (
	ValidColors = []string{}/* 103 elements not displayed */

)

Functions

func FindLabelIdsByNames

func FindLabelIdsByNames(ctx goog_context.Context, ui app_ui.UI, userId string, names []string) (labelIds []string, err error)

func FindOrAddLabelIdsByNames

func FindOrAddLabelIdsByNames(ctx goog_context.Context, ui app_ui.UI, userId string, names []string) (labelIds []string, err error)

Types

type Label

type Label interface {
	Add(name string, opts ...Opt) (label *mo_label.Label, err error)
	Update(id string, opts ...Opt) (label *mo_label.Label, err error)
	Remove(id string) error
	Resolve(id string) (label *mo_label.Label, err error)
	ResolveByName(name string) (label *mo_label.Label, err error)
	// Return labels when all labels found.
	ResolveByNames(names []string) (labels []*mo_label.Label, missing []string, err error)
	List() (labels []*mo_label.Label, err error)
}

func New

func New(ctx goog_context.Context, userId string) Label

func NewCached

func NewCached(ctx goog_context.Context, userId string) Label

type LabelColorParam

type LabelColorParam struct {
	BackgroundColor string `json:"backgroundColor,omitempty"`
	TextColor       string `json:"textColor,omitempty"`
}

type LabelParam

type LabelParam struct {
	LabelListVisibility   string           `json:"labelListVisibility,omitempty"`
	MessageListVisibility string           `json:"messageListVisibility,omitempty"`
	Color                 *LabelColorParam `json:"color,omitempty"`
	Name                  string           `json:"name"`
}

type MsgFindLabel

type MsgFindLabel struct {
	ErrorLabelNotFound  app_msg.Message
	ErrorFailedAddLabel app_msg.Message
}

type Opt

type Opt func(o Opts) Opts

func ColorBackground

func ColorBackground(c string) Opt

func ColorText

func ColorText(c string) Opt

func LabelListVisibility

func LabelListVisibility(v string) Opt

func MessageListVisibility

func MessageListVisibility(v string) Opt

func Name

func Name(v string) Opt

type Opts

type Opts struct {
	LabelListVisibility   string
	MessageListVisibility string
	ColorBackground       string
	ColorText             string
	Name                  string
}

func (Opts) Apply

func (z Opts) Apply(opts ...Opt) Opts

func (Opts) Param

func (z Opts) Param() LabelParam

Jump to

Keyboard shortcuts

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