Help us shape the future of Go! Take the 2026 Go Developer Survey

schema

package
v0.0.39 Latest Latest
Warning

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

Go to latest
Published: Jun 24, 2024 License: Apache-2.0 Imports: 11 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

type Client interface {
	// returns schema name, vendor, version, and files path(s)
	GetSchemaDetails(ctx context.Context, in *sdcpb.GetSchemaDetailsRequest, opts ...grpc.CallOption) (*sdcpb.GetSchemaDetailsResponse, error)
	// lists known schemas with name, vendor, version and status
	ListSchema(ctx context.Context, in *sdcpb.ListSchemaRequest, opts ...grpc.CallOption) (*sdcpb.ListSchemaResponse, error)
	// returns the schema of an item identified by a gNMI-like path
	GetSchema(ctx context.Context, in *sdcpb.GetSchemaRequest, opts ...grpc.CallOption) (*sdcpb.GetSchemaResponse, error)
	// creates a schema
	CreateSchema(ctx context.Context, in *sdcpb.CreateSchemaRequest, opts ...grpc.CallOption) (*sdcpb.CreateSchemaResponse, error)
	// trigger schema reload
	ReloadSchema(ctx context.Context, in *sdcpb.ReloadSchemaRequest, opts ...grpc.CallOption) (*sdcpb.ReloadSchemaResponse, error)
	// delete a schema
	DeleteSchema(ctx context.Context, in *sdcpb.DeleteSchemaRequest, opts ...grpc.CallOption) (*sdcpb.DeleteSchemaResponse, error)
	// client stream RPC to upload yang files to the server:
	// - uses CreateSchema as a first message
	// - then N intermediate UploadSchemaFile, initial, bytes, hash for each file
	// - and ends with an UploadSchemaFinalize{}
	UploadSchema(ctx context.Context, opts ...grpc.CallOption) (sdcpb.SchemaServer_UploadSchemaClient, error)
	// ToPath converts a list of items into a schema.proto.Path
	ToPath(ctx context.Context, in *sdcpb.ToPathRequest, opts ...grpc.CallOption) (*sdcpb.ToPathResponse, error)
	// ExpandPath returns a list of sub paths given a single path
	ExpandPath(ctx context.Context, in *sdcpb.ExpandPathRequest, opts ...grpc.CallOption) (*sdcpb.ExpandPathResponse, error)

	// overwrites
	// TOOD: uploadSchema
	GetSchemaElements(ctx context.Context, req *sdcpb.GetSchemaRequest, opts ...grpc.CallOption) (chan *sdcpb.SchemaElem, error)
}

func NewLocalClient

func NewLocalClient(store schemaStore.Store) Client

func NewRemoteClient

func NewRemoteClient(cc *grpc.ClientConn, cacheConfig *config.RemoteSchemaCache) Client

Jump to

Keyboard shortcuts

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