Documentation ¶
Index ¶
- Variables
- func CacheUpdateSliceToStringSlice(s []*cache.Update) []string
- func ConfigureCacheClientMock(t *testing.T, cacheClient *mockcacheclient.MockClient, ...)
- func DiffCacheUpdates(a, b []*cache.Update) string
- func DiffDoubleStringPathSlice(s1, s2 [][]string) string
- func DiffStringSlice(s1, s2 []string, forceNoSideEffect bool) string
- func GetLeafListTvProto(t *testing.T, tvs []*sdcpb.TypedValue) []byte
- func GetSchemaClientBound(t *testing.T) (*mockschemaclientbound.MockSchemaClientBound, error)
- func GetStringTvProto(t *testing.T, s string) []byte
- func GetTestFilename() string
- func GetUIntTvProto(t *testing.T, i uint64) []byte
- func InitSDCIOSchema() (dataschema.Client, *dConfig.SchemaConfig, error)
- func PathMapIndex(elems []string) string
- type SchemaClient
- func (s *SchemaClient) CreateSchema(ctx context.Context, in *sdcpb.CreateSchemaRequest, opts ...grpc.CallOption) (*sdcpb.CreateSchemaResponse, error)
- func (s *SchemaClient) DeleteSchema(ctx context.Context, in *sdcpb.DeleteSchemaRequest, opts ...grpc.CallOption) (*sdcpb.DeleteSchemaResponse, error)
- func (s *SchemaClient) ExpandPath(ctx context.Context, in *sdcpb.ExpandPathRequest, opts ...grpc.CallOption) (*sdcpb.ExpandPathResponse, error)
- func (s *SchemaClient) GetSchema(ctx context.Context, in *sdcpb.GetSchemaRequest, opts ...grpc.CallOption) (*sdcpb.GetSchemaResponse, error)
- func (s *SchemaClient) GetSchemaDetails(ctx context.Context, in *sdcpb.GetSchemaDetailsRequest, ...) (*sdcpb.GetSchemaDetailsResponse, error)
- func (s *SchemaClient) GetSchemaElements(ctx context.Context, req *sdcpb.GetSchemaRequest, opts ...grpc.CallOption) (chan *sdcpb.SchemaElem, error)
- func (s *SchemaClient) ListSchema(ctx context.Context, in *sdcpb.ListSchemaRequest, opts ...grpc.CallOption) (*sdcpb.ListSchemaResponse, error)
- func (s *SchemaClient) ReloadSchema(ctx context.Context, in *sdcpb.ReloadSchemaRequest, opts ...grpc.CallOption) (*sdcpb.ReloadSchemaResponse, error)
- func (s *SchemaClient) ToPath(ctx context.Context, in *sdcpb.ToPathRequest, opts ...grpc.CallOption) (*sdcpb.ToPathResponse, error)
- func (s *SchemaClient) UploadSchema(ctx context.Context, opts ...grpc.CallOption) (sdcpb.SchemaServer_UploadSchemaClient, error)
Constants ¶
This section is empty.
Variables ¶
var (
// location of the test schema from the projects root
SDCIO_SCHEMA_LOCATION = "tests/schema"
)
Functions ¶
func CacheUpdateSliceToStringSlice ¶
CacheUpdateSliceToStringSlice converts a []*cache.Update to []string
func DiffCacheUpdates ¶
diffCacheUpdates takes two []*cache.Update and compares the diff
func DiffStringSlice ¶
DiffStringSlice compares two string slices returning the
func GetLeafListTvProto ¶ added in v0.0.40
func GetLeafListTvProto(t *testing.T, tvs []*sdcpb.TypedValue) []byte
func GetSchemaClientBound ¶ added in v0.0.44
func GetSchemaClientBound(t *testing.T) (*mockschemaclientbound.MockSchemaClientBound, error)
GetSchemaClientBound creates a SchemaClientBound mock that responds to certain GetSchema requests
func GetStringTvProto ¶
GetStringTvProto takes a string and returns the sdcpb.TypedValue for it in proto encoding as []byte
func GetTestFilename ¶
func GetTestFilename() string
func GetUIntTvProto ¶
GetStringTvProto takes a string and returns the sdcpb.TypedValue for it in proto encoding as []byte
func InitSDCIOSchema ¶
func InitSDCIOSchema() (dataschema.Client, *dConfig.SchemaConfig, error)
func PathMapIndex ¶
PathMapIndex calculates a common map index for string slice based paths
Types ¶
type SchemaClient ¶
type SchemaClient struct {
schemaStore.Store
}
func (*SchemaClient) CreateSchema ¶
func (s *SchemaClient) CreateSchema(ctx context.Context, in *sdcpb.CreateSchemaRequest, opts ...grpc.CallOption) (*sdcpb.CreateSchemaResponse, error)
creates a schema
func (*SchemaClient) DeleteSchema ¶
func (s *SchemaClient) DeleteSchema(ctx context.Context, in *sdcpb.DeleteSchemaRequest, opts ...grpc.CallOption) (*sdcpb.DeleteSchemaResponse, error)
delete a schema
func (*SchemaClient) ExpandPath ¶
func (s *SchemaClient) ExpandPath(ctx context.Context, in *sdcpb.ExpandPathRequest, opts ...grpc.CallOption) (*sdcpb.ExpandPathResponse, error)
ExpandPath returns a list of sub paths given a single path
func (*SchemaClient) GetSchema ¶
func (s *SchemaClient) GetSchema(ctx context.Context, in *sdcpb.GetSchemaRequest, opts ...grpc.CallOption) (*sdcpb.GetSchemaResponse, error)
returns the schema of an item identified by a gNMI-like path
func (*SchemaClient) GetSchemaDetails ¶
func (s *SchemaClient) GetSchemaDetails(ctx context.Context, in *sdcpb.GetSchemaDetailsRequest, opts ...grpc.CallOption) (*sdcpb.GetSchemaDetailsResponse, error)
returns schema name, vendor, version, and files path(s)
func (*SchemaClient) GetSchemaElements ¶
func (s *SchemaClient) GetSchemaElements(ctx context.Context, req *sdcpb.GetSchemaRequest, opts ...grpc.CallOption) (chan *sdcpb.SchemaElem, error)
func (*SchemaClient) ListSchema ¶
func (s *SchemaClient) ListSchema(ctx context.Context, in *sdcpb.ListSchemaRequest, opts ...grpc.CallOption) (*sdcpb.ListSchemaResponse, error)
lists known schemas with name, vendor, version and status
func (*SchemaClient) ReloadSchema ¶
func (s *SchemaClient) ReloadSchema(ctx context.Context, in *sdcpb.ReloadSchemaRequest, opts ...grpc.CallOption) (*sdcpb.ReloadSchemaResponse, error)
trigger schema reload
func (*SchemaClient) ToPath ¶
func (s *SchemaClient) ToPath(ctx context.Context, in *sdcpb.ToPathRequest, opts ...grpc.CallOption) (*sdcpb.ToPathResponse, error)
ToPath converts a list of items into a schema.proto.Path
func (*SchemaClient) UploadSchema ¶
func (s *SchemaClient) UploadSchema(ctx context.Context, opts ...grpc.CallOption) (sdcpb.SchemaServer_UploadSchemaClient, error)