Documentation ¶
Index ¶
- Variables
- func BytesField(name string) *bytesBuilder
- func MapField[K comparable, V any](name string) *otherBuilder
- func PropertiesField(name string) *otherBuilder
- func SliceField[T any](name string) *otherBuilder
- func StringField(name string) *stringBuilder
- type Bytes
- type Map
- type Properties
- type Property
- func AnyProperty(v any) Property
- func BoolProperty(v bool) Property
- func DurationProperty(v time.Duration) Property
- func Float32Property(v float32) Property
- func Float64Property(v float64) Property
- func Int16Property(v int16) Property
- func Int32Property(v int32) Property
- func Int64Property(v int64) Property
- func Int8Property(v int8) Property
- func IntProperty(v int) Property
- func MapProperty[T any](v map[string]T) Property
- func ObjectProperty[T any](v T) Property
- func SetProperty[T comparable](v sets.Set[T]) Property
- func SliceProperty[T any](v []T) Property
- func StringProperty(v string) Property
- func Uint16Property(v uint16) Property
- func Uint32Property(v uint32) Property
- func Uint64Property(v uint64) Property
- func Uint8Property(v uint8) Property
- func UintProperty(v uint) Property
- type Slice
- type String
Constants ¶
This section is empty.
Variables ¶
var EncryptorConfig = vars.NewSetOnce[cryptox.Encryptor](cryptox.Null())
EncryptorConfig holds the config of the String encryption.
Functions ¶
func BytesField ¶
func BytesField(name string) *bytesBuilder
BytesField returns a new ent.Field with type Bytes.
func MapField ¶
func MapField[K comparable, V any](name string) *otherBuilder
MapField returns a new ent.Field with type Map.
func PropertiesField ¶
func PropertiesField(name string) *otherBuilder
PropertiesField returns a new ent.Field with type Properties.
func SliceField ¶
SliceField returns a new ent.Field with type Slice.
func StringField ¶
func StringField(name string) *stringBuilder
StringField returns a new ent.Field with type String.
Types ¶
type Map ¶
type Map[K comparable, V any] map[K]V
Map shows the secret value in map but stores in byte array.
type Properties ¶
Properties holds the secret Property collection in map, the key of map is the name of Property, stores into byte array.
type Property ¶
type Property struct { // Value specifies the value of this property. Value property.Value `json:"value,omitempty"` // Visible indicates to show the value of this property or not. Visible bool `json:"visible"` }
Property wraps the property.Property, and erases the invisible value during output.
func BoolProperty ¶
BoolProperty wraps bool value into a property.
func DurationProperty ¶
DurationProperty wraps time.Duration value into a property.
func Float32Property ¶
Float32Property wraps float32 value into a property.
func Float64Property ¶
Float64Property wraps float64 value into a property.
func Int16Property ¶
Int16Property wraps int16 value into a property.
func Int32Property ¶
Int32Property wraps int32 value into a property.
func Int64Property ¶
Int64Property wraps int64 value into a property.
func Int8Property ¶
Int8Property wraps int8 value into a property.
func MapProperty ¶
MapProperty wraps map value into a property.
func ObjectProperty ¶
ObjectProperty wraps object value into a property.
func SetProperty ¶
func SetProperty[T comparable](v sets.Set[T]) Property
SetProperty wraps set value into a property.
func SliceProperty ¶
SliceProperty wraps slice value into a property.
func StringProperty ¶
StringProperty wraps string value into a property.
func Uint16Property ¶
Uint16Property wraps uint16 value into a property.
func Uint32Property ¶
Uint32Property wraps uint32 value into a property.
func Uint64Property ¶
Uint64Property wraps uint64 value into a property.
func Uint8Property ¶
Uint8Property wraps uint8 value into a property.
func UintProperty ¶
UintProperty wraps uint value into a property.
func (Property) MarshalJSON ¶
MarshalJSON implements json.Marshaler, impacts the response message.