det

package
v1.0.2 Latest Latest
Warning

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

Go to latest
Published: May 23, 2023 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var File_proto_determined_proto protoreflect.FileDescriptor

Functions

func JsonUnmarshal

func JsonUnmarshal(dat []byte, current interface{}, endpoint *Struct, ref map[string]interface{}) error

JsonUnmarshal unmarshals JSON data with interfaces determined by Determined.

  • dat: JSON data
  • current: object as interface
  • endpoint: Determined
  • ref: struct map, with key being string name and value pointer to struct

Types

type ListStruct

type ListStruct struct {
	ListFields []*Struct `protobuf:"bytes,1,rep,name=list_fields,json=listFields,proto3" json:"list_fields,omitempty"`
	// contains filtered or unexported fields
}

func (*ListStruct) Descriptor deprecated

func (*ListStruct) Descriptor() ([]byte, []int)

Deprecated: Use ListStruct.ProtoReflect.Descriptor instead.

func (*ListStruct) GetListFields

func (x *ListStruct) GetListFields() []*Struct

func (*ListStruct) ProtoMessage

func (*ListStruct) ProtoMessage()

func (*ListStruct) ProtoReflect

func (x *ListStruct) ProtoReflect() protoreflect.Message

func (*ListStruct) Reset

func (x *ListStruct) Reset()

func (*ListStruct) String

func (x *ListStruct) String() string

type MapStruct

type MapStruct struct {
	MapFields map[string]*Struct `` /* 176-byte string literal not displayed */
	// contains filtered or unexported fields
}

func (*MapStruct) Descriptor deprecated

func (*MapStruct) Descriptor() ([]byte, []int)

Deprecated: Use MapStruct.ProtoReflect.Descriptor instead.

func (*MapStruct) GetMapFields

func (x *MapStruct) GetMapFields() map[string]*Struct

func (*MapStruct) ProtoMessage

func (*MapStruct) ProtoMessage()

func (*MapStruct) ProtoReflect

func (x *MapStruct) ProtoReflect() protoreflect.Message

func (*MapStruct) Reset

func (x *MapStruct) Reset()

func (*MapStruct) String

func (x *MapStruct) String() string

type Struct

type Struct struct {
	ClassName string            `protobuf:"bytes,1,opt,name=ClassName,proto3" json:"ClassName,omitempty"`
	Fields    map[string]*Value `` /* 153-byte string literal not displayed */
	// contains filtered or unexported fields
}

func NewStruct

func NewStruct(name string, v ...map[string]interface{}) (*Struct, error)

NewStruct constructs a Struct from a generic Go map. The map keys must be valid UTF-8. The map values are converted using NewValue.

func (*Struct) Descriptor deprecated

func (*Struct) Descriptor() ([]byte, []int)

Deprecated: Use Struct.ProtoReflect.Descriptor instead.

func (*Struct) GetClassName

func (x *Struct) GetClassName() string

func (*Struct) GetFields

func (x *Struct) GetFields() map[string]*Value

func (*Struct) ProtoMessage

func (*Struct) ProtoMessage()

func (*Struct) ProtoReflect

func (x *Struct) ProtoReflect() protoreflect.Message

func (*Struct) Reset

func (x *Struct) Reset()

func (*Struct) String

func (x *Struct) String() string

type Value

type Value struct {

	// The kind of value.
	//
	// Types that are assignable to Kind:
	//	*Value_SingleStruct
	//	*Value_ListStruct
	//	*Value_MapStruct
	Kind isValue_Kind `protobuf_oneof:"kind"`
	// contains filtered or unexported fields
}

func NewValue

func NewValue(v interface{}) (*Value, error)

NewValue constructs a Value from generic Go interface v.

	╔═══════════════════════════╤══════════════════════════════╗
	║ Go type                   │ Conversion                   ║
	╠═══════════════════════════╪══════════════════════════════╣
	║ string                    │ ending SingleStruct value    ║
	║ []string                  │ ending ListStruct value      ║
	║ map[string]string         │ ending MapStruct value       ║
 ║                           │                              ║
	║ [2]interface{}            │ SingleStruct value           ║
	║ [][2]interface{}          │ ListStruct value             ║
	║ map[string][2]interface{} │ MapStruct value              ║
 ║                           │                              ║
 ║ *Struct                   │ SingleStruct                 ║
 ║ []*Struct                 │ ListStruct                   ║
 ║ map[string]*Struct        │ MapStruct                    ║
	╚═══════════════════════════╧══════════════════════════════╝

func (*Value) Descriptor deprecated

func (*Value) Descriptor() ([]byte, []int)

Deprecated: Use Value.ProtoReflect.Descriptor instead.

func (*Value) GetKind

func (m *Value) GetKind() isValue_Kind

func (*Value) GetListStruct

func (x *Value) GetListStruct() *ListStruct

func (*Value) GetMapStruct

func (x *Value) GetMapStruct() *MapStruct

func (*Value) GetSingleStruct

func (x *Value) GetSingleStruct() *Struct

func (*Value) ProtoMessage

func (*Value) ProtoMessage()

func (*Value) ProtoReflect

func (x *Value) ProtoReflect() protoreflect.Message

func (*Value) Reset

func (x *Value) Reset()

func (*Value) String

func (x *Value) String() string

type Value_ListStruct

type Value_ListStruct struct {
	ListStruct *ListStruct `protobuf:"bytes,2,opt,name=list_struct,json=listStruct,proto3,oneof"`
}

type Value_MapStruct

type Value_MapStruct struct {
	MapStruct *MapStruct `protobuf:"bytes,3,opt,name=map_struct,json=mapStruct,proto3,oneof"`
}

type Value_SingleStruct

type Value_SingleStruct struct {
	SingleStruct *Struct `protobuf:"bytes,1,opt,name=single_struct,json=singleStruct,proto3,oneof"`
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL
JackTT - Gopher 🇻🇳