Documentation
¶
Index ¶
- type PropertyObject
- func (p *PropertyObject) Clear()
- func (p *PropertyObject) Count() int
- func (p *PropertyObject) Get(key string) any
- func (p *PropertyObject) Has(key string) bool
- func (p *PropertyObject) Keys() []string
- func (p *PropertyObject) Set(key string, value any) error
- func (p *PropertyObject) Unset(key string)
- type PropertyObjectInterface
- type SerializableInterface
- type SerializablePropertyObject
- type SerializablePropertyObjectInterface
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type PropertyObject ¶
type PropertyObject struct {
// contains filtered or unexported fields
}
PropertyObject is a basic implementation of PropertyObjectInterface
func (*PropertyObject) Count ¶
func (p *PropertyObject) Count() int
Count returns the number of properties
func (*PropertyObject) Get ¶
func (p *PropertyObject) Get(key string) any
Get retrieves a property value by key
func (*PropertyObject) Has ¶
func (p *PropertyObject) Has(key string) bool
Has checks if a property exists
func (*PropertyObject) Keys ¶
func (p *PropertyObject) Keys() []string
Keys returns all property keys
func (*PropertyObject) Set ¶
func (p *PropertyObject) Set(key string, value any) error
Set stores a property value with the given key
func (*PropertyObject) Unset ¶
func (p *PropertyObject) Unset(key string)
Unset removes a property by key
type PropertyObjectInterface ¶
type PropertyObjectInterface interface {
Clear()
Count() int
Get(key string) any
Has(key string) bool
Keys() []string
Set(key string, value any) error
Unset(key string)
}
PropertyObjectInterface defines the interface for objects that can store and retrieve properties
func NewPropertyObject ¶
func NewPropertyObject() PropertyObjectInterface
NewPropertyObject creates a new PropertyObject
type SerializableInterface ¶
type SerializableInterface interface {
// GetID returns the unique identifier for this object
GetID() string
// SetID sets the unique identifier for this object
SetID(id string)
// ToJSON serializes the object to JSON
ToJSON() ([]byte, error)
// FromJSON deserializes JSON data into the object
FromJSON(data []byte) error
}
SerializableInterface defines an interface for objects that can be serialized/deserialized
type SerializablePropertyObject ¶
type SerializablePropertyObject struct {
PropertyObject
}
SerializablePropertyObject extends PropertyObject with ID and serialization capabilities
func (*SerializablePropertyObject) FromJSON ¶
func (s *SerializablePropertyObject) FromJSON(data []byte) error
FromJSON deserializes JSON data into the SerializablePropertyObject
func (*SerializablePropertyObject) GetID ¶
func (s *SerializablePropertyObject) GetID() string
GetID returns the unique identifier for this object
func (*SerializablePropertyObject) SetID ¶
func (s *SerializablePropertyObject) SetID(id string)
SetID sets the unique identifier for this object
func (*SerializablePropertyObject) ToJSON ¶
func (s *SerializablePropertyObject) ToJSON() ([]byte, error)
ToJSON serializes the SerializablePropertyObject to JSON
type SerializablePropertyObjectInterface ¶
type SerializablePropertyObjectInterface interface {
PropertyObjectInterface
SerializableInterface
}
SerializablePropertyObjectInterface combines PropertyObjectInterface and SerializableInterface
func NewSerializablePropertyObject ¶
func NewSerializablePropertyObject() SerializablePropertyObjectInterface
NewSerializablePropertyObject creates a new SerializablePropertyObject with a generated UUID