more

package
v0.0.0-...-843cdbd Latest Latest
Warning

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

Go to latest
Published: Sep 4, 2023 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Array

type Array []Item

func (Array) Verify

func (arr Array) Verify() *errors.Error

type Input

type Input struct {
	Alias string `bson:"alias" json:"alias"` //别名,可以设置多个别名,通过","(半角逗号)分割
	Intro string `bson:"intro" json:"intro"` //主介绍
	More  Array  `bson:"more" json:"more"`   //更多信息内容
	// contains filtered or unexported fields
}

func (*Input) ToMore

func (m *Input) ToMore() More

func (*Input) Verify

func (m *Input) Verify(requireKey ...string) *errors.Error

type Item

type Item struct {
	Key   string `bson:"key" json:"key"`
	Value string `bson:"value" json:"value"`
	Seq   int    `bson:"seq" json:"seq"`
}

func (Item) GetCode

func (m Item) GetCode() string

func (Item) GetSeq

func (m Item) GetSeq() int

func (Item) Verify

func (m Item) Verify() *errors.Error

type More

type More map[string]Item

func InputToMore

func InputToMore(in *Input) More

func Mix

func Mix(moreM More, setM *Set) (More, bool)

Mix 分析更改 *more.More: 新的More bool: 是否有变化

func NewMore

func NewMore() More

func OfArray

func OfArray(arr Array) More

func (More) Get

func (m More) Get(key string) string

func (More) Put

func (m More) Put(key string, value string, seq ...int) More

func (More) ToArray

func (m More) ToArray() Array

type Set

type Set struct {
	Yes     bool     `bson:"yes" json:"yes"`
	Newest  Array    `bson:"newest" json:"newest"`   //新增或更新
	Removed []string `bson:"removed" json:"removed"` //需要移除的
}

func (*Set) Verify

func (m *Set) Verify() *errors.Error

Jump to

Keyboard shortcuts

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