package scheme
import "github.com/ydb-platform/ydb-go-sdk/v3/scheme"
Example¶
Code:
{
ctx := context.TODO()
db, err := ydb.Open(ctx, "grpc://localhost:2136/local")
if err != nil {
fmt.Printf("failed to connect: %v", err)
return
}
defer db.Close(ctx) // cleanup resources
err = db.Scheme().MakeDirectory(ctx, "/local/test")
if err != nil {
fmt.Printf("failed to make directory: %v", err)
}
d, err := db.Scheme().ListDirectory(ctx, "/local/test")
if err != nil {
fmt.Printf("failed to list directory: %v", err)
}
fmt.Printf("list directory: %+v\n", d)
}
Index ¶
- type Client
- type Directory
- type Entry
- func InnerConvertEntry(y *Ydb_Scheme.Entry) *Entry
- func (e *Entry) From(y *Ydb_Scheme.Entry)
- func (e *Entry) IsBlockStoreVolume() bool
- func (e *Entry) IsColumnTable() bool
- func (e *Entry) IsCoordinationNode() bool
- func (e *Entry) IsDatabase() bool
- func (e *Entry) IsDirectory() bool
- func (e *Entry) IsPersQueueGroup() bool
- func (e *Entry) IsRtmrVolume() bool
- func (e *Entry) IsTable() bool
- func (e *Entry) IsTopic() bool
- type EntryType
- type Permissions
- type PermissionsOption
Examples ¶
Types ¶
type Client ¶
type Client interface { Database() string DescribePath(ctx context.Context, path string) (e Entry, err error) MakeDirectory(ctx context.Context, path string) (err error) ListDirectory(ctx context.Context, path string) (d Directory, err error) RemoveDirectory(ctx context.Context, path string) (err error) ModifyPermissions(ctx context.Context, path string, opts ...PermissionsOption) (err error) }
type Directory ¶
type Entry ¶
type Entry struct { Name string Owner string Type EntryType Permissions []Permissions EffectivePermissions []Permissions }
func InnerConvertEntry ¶
func InnerConvertEntry(y *Ydb_Scheme.Entry) *Entry
func (*Entry) From ¶
func (e *Entry) From(y *Ydb_Scheme.Entry)
func (*Entry) IsBlockStoreVolume ¶
func (*Entry) IsColumnTable ¶
func (*Entry) IsCoordinationNode ¶
func (*Entry) IsDatabase ¶
func (*Entry) IsDirectory ¶
func (*Entry) IsPersQueueGroup ¶
func (*Entry) IsRtmrVolume ¶
func (*Entry) IsTable ¶
func (*Entry) IsTopic ¶
type EntryType ¶
type EntryType uint
const ( EntryTypeUnknown EntryType = iota EntryDirectory EntryTable EntryPersQueueGroup EntryDatabase EntryRtmrVolume EntryBlockStoreVolume EntryCoordinationNode EntryTopic EntryColumnStore EntryColumnTable )
func (EntryType) String ¶
type Permissions ¶
func (Permissions) To ¶
func (p Permissions) To(y *Ydb_Scheme.Permissions)
type PermissionsOption ¶
type PermissionsOption func(permissionsDesc)
func WithChangeOwner ¶
func WithChangeOwner(owner string) PermissionsOption
func WithClearPermissions ¶
func WithClearPermissions() PermissionsOption
func WithGrantPermissions ¶
func WithGrantPermissions(p Permissions) PermissionsOption
func WithRevokePermissions ¶
func WithRevokePermissions(p Permissions) PermissionsOption
func WithSetPermissions ¶
func WithSetPermissions(p Permissions) PermissionsOption
Source Files ¶
- Version
- v3.53.4
- Published
- Oct 19, 2023
- Platform
- js/wasm
- Imports
- 2 packages
- Last checked
- 3 seconds ago –
Tools for package owners.