MCPcopy Create free account
hub / github.com/couchbase/cbft / toolPartitionSeqs

Function toolPartitionSeqs

cmd/cbft/tool.go:103–137  ·  view source on GitHub ↗
(cfg cbgt.Cfg, uuid string, tags []string,
	flags cbftFlags, options map[string]string)

Source from the content-addressed store, hash-verified

101}
102
103func toolPartitionSeqs(cfg cbgt.Cfg, uuid string, tags []string,
104 flags cbftFlags, options map[string]string) (exitCode int) {
105 sourceType := options["sourceType"]
106
107 feedType, exists := cbgt.FeedTypes[sourceType]
108 if !exists || feedType == nil {
109 fmt.Printf("tool: partitionSeqs: unknown sourceType: %s\n", sourceType)
110 return 1
111 }
112
113 if feedType.PartitionSeqs == nil {
114 return 0
115 }
116
117 partitionSeqs, err := feedType.PartitionSeqs(
118 sourceType,
119 options["sourceName"],
120 options["sourceUUID"],
121 options["sourceParams"],
122 flags.Server,
123 options)
124 if err != nil {
125 fmt.Printf("tool: partitionSeqs: err: %v\n", err)
126 return 1
127 }
128
129 b, err := json.Marshal(partitionSeqs)
130 if err != nil {
131 fmt.Printf("tool: partitionSeqs: json marshal, err: %v\n", err)
132 }
133
134 fmt.Printf("%s\n", string(b))
135
136 return 0
137}
138
139func toolRepeatable(body toolDefHandler) toolDefHandler {
140 f := func(cfg cbgt.Cfg, uuid string, tags []string,

Callers

nothing calls this directly

Calls 2

MarshalMethod · 0.80
PartitionSeqsMethod · 0.65

Tested by

no test coverage detected