{"modulePath":"github.com/matrixorigin/matrixcube","version":"v0.1.0","isLatest":false,"isStandardLibrary":false,"goos":"all","goarch":"all","docs":"# package command\n\n## Types\n\n```go\ntype Context interface {\n\t// WriteBatch returns the write batch for write application's data, it's only used in write command handle.\n\tWriteBatch() *util.WriteBatch\n\t// LogIndex log index, the raft log index of the current command, it's only used in write command handle.\n\tLogIndex() uint64\n\t// Offset is the index in the current command batch\n\tOffset() int\n\t// BatchSize number of the current command batch\n\tBatchSize() int\n\t// Attrs returns a map to store attrs\n\tAttrs() map[string]interface{}\n\t// ByteBuf returns the bytebuf\n\tByteBuf() *buf.ByteBuf\n\t// DataStorage returns data storage\n\tDataStorage() storage.DataStorage\n\t// StoreID returns store id\n\tStoreID() uint64\n}\n```\nContext apply context.\n\n```go\ntype LocalCommandFunc func(bhmetapb.Shard, *raftcmdpb.Request) (*raftcmdpb.Response, error)\n```\nLocalCommandFunc directly exec on local func\n\n```go\ntype ReadCommandFunc func(bhmetapb.Shard, *raftcmdpb.Request, Context) (resp *raftcmdpb.Response, readedBytes uint64)\n```\nReadCommandFunc the read command handler func\n\n```go\ntype WriteCommandFunc func(bhmetapb.Shard, *raftcmdpb.Request, Context) (writeBytes uint64, diffBytes int64, resp *raftcmdpb.Response)\n```\nWriteCommandFunc the write command handler func, returns write bytes and the diff bytes that used to modify the size of the current shard\n\n","path":"github.com/matrixorigin/matrixcube/command","name":"command","synopsis":"","isRedistributable":true}
