github.com/yankunsam/loki/v2@v2.6.3-0.20220817130409-389df5235c27/pkg/storage/stores/series/index/table_client.go (about) 1 package index 2 3 import ( 4 "context" 5 6 "github.com/grafana/loki/pkg/storage/config" 7 ) 8 9 // TableClient is a client for telling Dynamo what to do with tables. 10 type TableClient interface { 11 ListTables(ctx context.Context) ([]string, error) 12 CreateTable(ctx context.Context, desc config.TableDesc) error 13 DeleteTable(ctx context.Context, name string) error 14 DescribeTable(ctx context.Context, name string) (desc config.TableDesc, isActive bool, err error) 15 UpdateTable(ctx context.Context, current, expected config.TableDesc) error 16 Stop() 17 } 18 19 type byName []config.TableDesc 20 21 func (a byName) Len() int { return len(a) } 22 func (a byName) Swap(i, j int) { a[i], a[j] = a[j], a[i] } 23 func (a byName) Less(i, j int) bool { return a[i].Name < a[j].Name }