gitee.com/quant1x/engine@v1.8.4/cache/data_summary.go (about) 1 package cache 2 3 // DataSummary 数据概要 4 type DataSummary struct { 5 kind Kind // 类型 6 key string // 关键字 7 name string // 名称 8 owner string // 拥有者 9 usage string // 用法 10 } 11 12 func Summary(kind Kind, key, name, owner string, usage ...string) DataSummary { 13 var description string 14 if len(usage) > 0 { 15 description = usage[0] 16 } 17 return DataSummary{ 18 kind: kind, 19 key: key, 20 name: name, 21 owner: owner, 22 usage: description, 23 } 24 } 25 26 func (d DataSummary) Kind() Kind { 27 return d.kind 28 } 29 30 func (d DataSummary) Key() string { 31 return d.key 32 } 33 34 func (d DataSummary) Name() string { 35 return d.name 36 } 37 38 func (d DataSummary) Owner() string { 39 return d.owner 40 } 41 42 func (d DataSummary) Usage() string { 43 return d.usage 44 }