scheme

package
v3.80.10 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 19, 2024 License: Apache-2.0 Imports: 2 Imported by: 5

Documentation

Overview

Example
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)
Output:

Index

Examples

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

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 Directory struct {
	Entry
	Children []Entry
}

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 (e *Entry) IsBlockStoreVolume() bool

func (*Entry) IsColumnTable added in v3.47.5

func (e *Entry) IsColumnTable() bool

func (*Entry) IsCoordinationNode

func (e *Entry) IsCoordinationNode() bool

func (*Entry) IsDatabase

func (e *Entry) IsDatabase() bool

func (*Entry) IsDirectory

func (e *Entry) IsDirectory() bool

func (*Entry) IsPersQueueGroup

func (e *Entry) IsPersQueueGroup() bool

func (*Entry) IsRtmrVolume

func (e *Entry) IsRtmrVolume() bool

func (*Entry) IsTable

func (e *Entry) IsTable() bool

func (*Entry) IsTopic added in v3.38.2

func (e *Entry) IsTopic() bool

type EntryType

type EntryType uint
const (
	EntryTypeUnknown EntryType = iota
	EntryDirectory
	EntryTable
	EntryPersQueueGroup
	EntryDatabase
	EntryRtmrVolume
	EntryBlockStoreVolume
	EntryCoordinationNode
	EntryTopic
	EntryColumnStore
	EntryColumnTable
)

func (EntryType) String

func (t EntryType) String() string

type Permissions

type Permissions struct {
	Subject         string
	PermissionNames []string
}

func (Permissions) To

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

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL