gitlab.com/evatix-go/core@v1.3.55/keymk/newKeyWithLegendCreator.go (about) 1 package keymk 2 3 import "gitlab.com/evatix-go/core/constants" 4 5 type newKeyWithLegendCreator struct{} 6 7 // All 8 // 9 // Chain Sequence (Root-Package-Group-State-User-Item) 10 func (it *newKeyWithLegendCreator) All( 11 option *Option, 12 legendName LegendName, 13 isAttachLegendNames bool, 14 rootName, 15 packageName, 16 group, 17 stateName string, 18 ) *KeyWithLegend { 19 keyWithLegend := &KeyWithLegend{ 20 option: option, 21 LegendName: legendName, 22 rootName: rootName, 23 packageName: packageName, 24 groupName: group, 25 stateName: stateName, 26 isAttachLegendNames: isAttachLegendNames, 27 } 28 29 return keyWithLegend 30 } 31 32 // Create 33 // 34 // Chain Sequence (Root-Package-Group-State-User-Item) 35 func (it *newKeyWithLegendCreator) Create( 36 option *Option, 37 rootName, 38 packageName, 39 group string, 40 ) *KeyWithLegend { 41 keyWithLegend := &KeyWithLegend{ 42 option: option, 43 LegendName: FullLegends, 44 rootName: rootName, 45 packageName: packageName, 46 groupName: group, 47 isAttachLegendNames: true, 48 } 49 50 return keyWithLegend 51 } 52 53 // NoLegend 54 // 55 // Chain Sequence (Root-Package-Group-State-User-Item) 56 func (it *newKeyWithLegendCreator) NoLegend( 57 option *Option, 58 rootName, 59 packageName, 60 group string, 61 ) *KeyWithLegend { 62 keyWithLegend := &KeyWithLegend{ 63 option: option, 64 rootName: rootName, 65 packageName: packageName, 66 groupName: group, 67 isAttachLegendNames: false, 68 } 69 70 return keyWithLegend 71 } 72 73 // NoLegendPackage 74 // 75 // Chain Sequence (Root-Group-State-User-Item) 76 func (it *newKeyWithLegendCreator) NoLegendPackage( 77 isAttachLegend bool, 78 option *Option, 79 rootName, 80 group string, 81 ) *KeyWithLegend { 82 keyWithLegend := &KeyWithLegend{ 83 option: option, 84 rootName: rootName, 85 packageName: constants.EmptyString, 86 groupName: group, 87 isAttachLegendNames: isAttachLegend, 88 } 89 90 return keyWithLegend 91 } 92 93 func (it *newKeyWithLegendCreator) ShortLegend( 94 option *Option, 95 rootName, 96 packageName, 97 group string, 98 ) *KeyWithLegend { 99 keyWithLegend := &KeyWithLegend{ 100 option: option, 101 LegendName: ShortLegends, 102 rootName: rootName, 103 packageName: packageName, 104 groupName: group, 105 isAttachLegendNames: true, 106 } 107 108 return keyWithLegend 109 }