Documentation ¶
Index ¶
- Constants
- Variables
- func Backup(ctx context.Context, opt *BackupOption) error
- func InitClient(opt *DDBClientOption) error
- func PrittyPrintBytes(size int) *string
- type BackupOption
- type BatchRequest
- type BatchRequestGenerator
- type BatchRequestGeneratorOption
- type BatchResult
- type BatchWriteOutput
- type BatchWriter
- type DDBAction
- type DDBClient
- type DDBClientOption
- type DDBItem
- type DDBMode
- type ItemResult
- type SimulateOpt
- type SimulateResult
- type Table
Constants ¶
View Source
const ( BATCH_RECORD_NUM_LIMIT = 25 RECORD_BYTE_SIZE_LIMIT = 1000000 // 1MB READ_BUF_SIZE = 1000000 // 4KB LF_BYTE = 10 DEFAULT_UNIT_SIZE int = 100 // 4(WWU) * 25 = 100(WWU) )
View Source
const ( WU_UNIT = 1000 // 1KB RU_UNIT = 4000 // 4KB )
View Source
const GB_UNIT = 1000000000
View Source
const KB_UNIT = 1000
View Source
const LIMIT_SCAN_INTERVAL = 1 * time.Second
View Source
const MB_UNIT = 1000000
View Source
const (
RETRY_NUMBER = 3
)
View Source
const (
WRITE_LIMIT_BYTE_SIZE = 400000 // 400KB
)
Variables ¶
View Source
var ( OnDemand = DDBMode("OnDemand") Provisioned = DDBMode("Provisioned") )
View Source
var (
ErrBatchEOF = errors.New("BatchEOF")
)
Functions ¶
func InitClient ¶
func InitClient(opt *DDBClientOption) error
func PrittyPrintBytes ¶
Types ¶
type BackupOption ¶
type BatchRequest ¶ added in v0.0.4
type BatchRequest struct { TableName string WriteRequests []types.WriteRequest ByteSize int Retry int // contains filtered or unexported fields }
func (*BatchRequest) AddWriteRequest ¶ added in v0.0.4
func (b *BatchRequest) AddWriteRequest(ddbItem DDBItem) error
func (*BatchRequest) BatchWriteItemInput ¶ added in v0.0.4
func (b *BatchRequest) BatchWriteItemInput() *dynamodb.BatchWriteItemInput
func (*BatchRequest) Number ¶ added in v0.0.4
func (b *BatchRequest) Number() int
func (*BatchRequest) Reset ¶ added in v0.0.4
func (b *BatchRequest) Reset()
func (*BatchRequest) Size ¶ added in v0.0.4
func (b *BatchRequest) Size() int
type BatchRequestGenerator ¶ added in v0.0.4
type BatchRequestGenerator struct {
// contains filtered or unexported fields
}
func (*BatchRequestGenerator) Init ¶ added in v0.0.4
func (b *BatchRequestGenerator) Init(opt *BatchRequestGeneratorOption) (*BatchRequestGenerator, error)
type BatchRequestGeneratorOption ¶ added in v0.0.4
type BatchResult ¶ added in v0.0.4
type BatchResult struct { Content BatchWriteOutput Error error }
type BatchWriteOutput ¶ added in v0.0.4
type BatchWriter ¶ added in v0.0.4
type BatchWriter struct { Table *Table File *os.File DDBAction DDBAction LimitUnit *int RemainCount *int64 Results chan *BatchResult Done chan struct{} }
func (*BatchWriter) BatchWrite ¶ added in v0.0.4
func (b *BatchWriter) BatchWrite(ctx context.Context) error
type DDBClient ¶
var DdbClient *DDBClient
func (*DDBClient) BatchWrite ¶ added in v0.0.4
func (d *DDBClient) BatchWrite(ctx context.Context, req BatchRequest) (output BatchWriteOutput, err error)
type DDBClientOption ¶
type DDBClientOption struct {
Local string
}
type DDBItem ¶ added in v0.0.4
type DDBItem struct { Action DDBAction AttributeValue map[string]types.AttributeValue Keys []string Unit int ByteSize int }
func (*DDBItem) DeleteRequest ¶ added in v0.0.4
func (d *DDBItem) DeleteRequest() types.WriteRequest
func (*DDBItem) PutRequest ¶ added in v0.0.4
func (d *DDBItem) PutRequest() types.WriteRequest
func (*DDBItem) WriteReuest ¶ added in v0.0.4
func (d *DDBItem) WriteReuest() types.WriteRequest
type ItemResult ¶
func GetItemSizeByJSON ¶
func GetItemSizeByJSON(json map[string]interface{}) (*ItemResult, error)
type SimulateOpt ¶
type SimulateResult ¶
type SimulateResult struct { ConsumeRRU *int ConsumeWRU *int ConsumeRCU *int ConsumeWCU *int TotalItemSize int }
func Simulate ¶
func Simulate(opt *SimulateOpt) (*SimulateResult, error)
type Table ¶ added in v0.0.4
func (*Table) DDBItemFromString ¶ added in v0.0.4
func (*Table) Init ¶ added in v0.0.4
func (t *Table) Init(output *dynamodb.DescribeTableOutput)
Source Files ¶
Click to show internal directories.
Click to hide internal directories.