Documentation ¶
Overview ¶
Package embedcup contains the common models and embedded structs used across different entities in the Fabriktor. These structs represent shared fields and provide common functionality like Getters and Setters.
Package embedcup contains the common models and embedded structs used across different entities in the Fabriktor. These structs represent shared fields and provide common functionality like Getters and Setters.
Package embedcup contains the common models and embedded structs used across different entities in the Fabriktor. These structs represent shared fields and provide common functionality like Getters and Setters.
Package embedcup contains the common models and embedded structs used across different entities in the Fabriktor. These structs represent shared fields and provide common functionality like Getters and Setters.
Package embedcup contains the common models and embedded structs used across different entities in the Fabriktor. These structs represent shared fields and provide common functionality like Getters and Setters.
Index ¶
- type Address
- func (a *Address) GetCity() string
- func (a *Address) GetCountry() string
- func (a *Address) GetFormattedAddress() string
- func (a *Address) GetLatitude() float64
- func (a *Address) GetLongitude() float64
- func (a *Address) GetPlaceID() string
- func (a *Address) GetPlaceName() string
- func (a *Address) GetPostalCode() string
- func (a *Address) GetState() string
- func (a *Address) GetStreet() string
- func (a *Address) GetTimezone() string
- func (a *Address) SetCity(city string)
- func (a *Address) SetCountry(country string)
- func (a *Address) SetFormattedAddress(address string)
- func (a *Address) SetLatitude(latitude float64)
- func (a *Address) SetLongitude(longitude float64)
- func (a *Address) SetPlaceID(placeID string)
- func (a *Address) SetPlaceName(placeName string)
- func (a *Address) SetPostalCode(postalCode string)
- func (a *Address) SetState(state string)
- func (a *Address) SetStreet(street string)
- func (a *Address) SetTimezone(timezone string)
- func (a *Address) SetTimezoneFromCoordinates(ctx context.Context, c contracts.MapsClientInterface, latitude float64, ...) error
- type AddressKey
- type Archive
- type ArchiveKey
- type Common
- func (c *Common) GetCreatedAt() time.Time
- func (c *Common) GetID() primitive.ObjectID
- func (c *Common) GetSchemaVersion() string
- func (c *Common) GetUpdatedAt() time.Time
- func (c *Common) SetCreatedAt(createdAt time.Time)
- func (c *Common) SetID(id primitive.ObjectID)
- func (c *Common) SetSchemaVersion(version string)
- func (c *Common) SetUpdatedAt(updatedAt time.Time)
- type CommonKey
- type Date
- func (d *Date) GetDate() time.Time
- func (d *Date) GetDay() uint
- func (d *Date) GetHour() uint
- func (d *Date) GetMonth() uint
- func (d *Date) GetProcessedDate() time.Time
- func (d *Date) GetYear() uint
- func (d *Date) Process(timezone string, toUTC bool, toMidnight bool) error
- func (d *Date) SetDate(date time.Time)
- func (d *Date) SetDay(day uint)
- func (d *Date) SetHour(hour uint)
- func (d *Date) SetMonth(month uint)
- func (d *Date) SetProcessedDate(processedDate time.Time)
- func (d *Date) SetYear(year uint)
- type DateKey
- type Key
- type Owner
- type OwnerKey
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Address ¶ added in v1.39.0
type Address struct { // The complete formatted address, as returned by Google. // example: 1600 Amphitheatre Parkway, Mountain View, CA 94043, USA // required: false FormattedAddress *string `json:"formatted_address" bson:"formatted_address" validate:"nonnilpointer"` // The name of the place, typically for landmarks or specific locations. // example: Central Park // required: false PlaceName *string `json:"place_name" bson:"place_name" validate:"nonnilpointer"` // The street number and name of the address. // example: 1600 Amphitheatre Parkway // required: false Street *string `json:"street" bson:"street" validate:"nonnilpointer"` // The city or locality of the address. // example: Mountain View // required: false City *string `json:"city" bson:"city" validate:"nonnilpointer"` // The state, province, or region of the address. // example: CA // required: false State *string `json:"state" bson:"state" validate:"nonnilpointer"` // The postal code of the address. // example: 94043 // required: false PostalCode *string `json:"postal_code" bson:"postal_code" validate:"nonnilpointer"` // The country of the address. // example: USA // required: false Country *string `json:"country" bson:"country" validate:"nonnilpointer"` // The latitude of the location, if available. // example: 37.4224764 // required: false Latitude *float64 `json:"latitude" bson:"latitude" validate:"nonnilpointer"` // The longitude of the location, if available. // example: -122.0842499 // required: false Longitude *float64 `json:"longitude" bson:"longitude" validate:"nonnilpointer"` // The Google Place ID associated with the location. // example: ChIJ2eUgeAK6j4ARbn5u_wAGqWA // required: false PlaceID *string `json:"place_id" bson:"place_id" validate:"nonnilpointer"` // The timezone of the location implicitely computed from the coordinates. // example: America/New_York // readOnly: true Timezone *string `bson:"timezone" json:"timezone" validate:"nonnilpointer"` }
Address represents an address picked from a Flutter Google location picker. swagger:model
func NewAddress ¶ added in v1.39.8
func NewAddressWithTimezone ¶ added in v1.40.2
func (*Address) GetCountry ¶ added in v1.39.0
func (*Address) GetFormattedAddress ¶ added in v1.39.0
func (*Address) GetLatitude ¶ added in v1.39.0
func (*Address) GetLongitude ¶ added in v1.39.0
func (*Address) GetPlaceID ¶ added in v1.39.0
func (*Address) GetPlaceName ¶ added in v1.39.0
func (*Address) GetPostalCode ¶ added in v1.39.0
func (*Address) GetTimezone ¶ added in v1.39.0
func (*Address) SetCountry ¶ added in v1.39.0
func (*Address) SetFormattedAddress ¶ added in v1.39.0
func (*Address) SetLatitude ¶ added in v1.39.0
func (*Address) SetLongitude ¶ added in v1.39.0
func (*Address) SetPlaceID ¶ added in v1.39.0
func (*Address) SetPlaceName ¶ added in v1.39.0
func (*Address) SetPostalCode ¶ added in v1.39.0
func (*Address) SetTimezone ¶ added in v1.39.0
func (*Address) SetTimezoneFromCoordinates ¶ added in v1.39.0
func (a *Address) SetTimezoneFromCoordinates(ctx context.Context, c contracts.MapsClientInterface, latitude float64, longitude float64) error
SetTimezoneFromCoordinates sets the timezone from the given coordinates.
type AddressKey ¶ added in v1.39.2
type AddressKey = Key
AddressKey represents a key for address-related fields.
const ( AddressStreetKey AddressKey = "street" AddressCityKey AddressKey = "city" AddressStateKey AddressKey = "state" AddressPostalCodeKey AddressKey = "postal_code" AddressCountryKey AddressKey = "country" AddressLatitudeKey AddressKey = "latitude" AddressLongitudeKey AddressKey = "longitude" AddressPlaceIDKey AddressKey = "place_id" AddressTimezoneKey AddressKey = "timezone" AddressFormattedAddressKey AddressKey = "formatted_address" AddressPlaceNameKey AddressKey = "place_name" )
type Archive ¶ added in v1.35.20
type Archive struct { // Indicates whether the document is archived. // example: false // required: false IsArchived *bool `bson:"is_archived" json:"is_archived" validate:"nonnilpointer"` }
Archive provides a mechanism to flag documents as archived.
This flag enables filtering without preventing access to archived documents.
It serves as an alternative to deletion, helping maintain data integrity and supporting queries for deprecated or legacy documents. swagger:model
func NewArchive ¶ added in v1.39.8
func (*Archive) GetIsArchived ¶ added in v1.35.20
func (*Archive) SetIsArchived ¶ added in v1.35.20
type ArchiveKey ¶ added in v1.39.2
type ArchiveKey = Key
ArchiveKey represents a key for archive-related fields.
const (
ArchiveIsArchivedKey ArchiveKey = "is_archived"
)
type Common ¶
type Common struct { // The MongoDB ID of the document. // example: 5f6d4b9b9c6f9f0001b9c6f9 // readOnly: true ID *primitive.ObjectID `bson:"_id,omitempty" json:"_id,omitempty"` // The schema version of the document. // example: v1 // readOnly: true SchemaVersion *string `bson:"schema_version" json:"schema_version" conform:"lower" validate:"nonnilpointer,nonzeropointerelem"` // The last time the document was updated. // example: 2020-10-05T10:00:00Z // readOnly: true UpdatedAt *time.Time `bson:"updated_at" json:"updated_at" validate:"nonnilpointer,nonzeropointerelem"` // The time the document was created. // example: 2020-10-05T10:00:00Z // readOnly: true CreatedAt *time.Time `bson:"created_at" json:"created_at" validate:"nonnilpointer,nonzeropointerelem"` }
Common represents the common fields for all entities, embedded in all entities. swagger:model
func (*Common) GetCreatedAt ¶
func (*Common) GetSchemaVersion ¶
func (*Common) GetUpdatedAt ¶
func (*Common) SetCreatedAt ¶
func (*Common) SetSchemaVersion ¶
func (*Common) SetUpdatedAt ¶
type CommonKey ¶ added in v1.39.2
type CommonKey = Key
CommonKey represents a key for common fields.
type Date ¶ added in v1.40.1
type Date struct { // The input date and time in RFC 3339 format, initially set to America/New_York, with the option to override the timezone using the Process method, normalize to midnight, and convert to UTC as per Fabriktor's group README. // example: 2021-01-01T00:00:00Z // required: true Date *time.Time `json:"date" bson:"date" validate:"nonnilpointer,nonzeropointerelem"` // ProcessedDate is the date after timezone override, normalization to midnight, and conversion to UTC. If no processing occurs, this field will be equal to date field. // example: 2021-01-01T00:00:00Z // readOnly: true ProcessedDate *time.Time `json:"processed_date" bson:"processed_date" validate:"nonnilpointer,nonzeropointerelem,isutc"` // Day extracted from the normalized date. // example: 1 // readOnly: true Day *uint `json:"day" bson:"day" validate:"nonnilpointer,nonzeropointerelem"` // Month extracted from the normalized date. // example: 1 // readOnly: true Month *uint `json:"month" bson:"month" validate:"nonnilpointer,nonzeropointerelem"` // Year extracted from the normalized date. // example: 2021 // readOnly: true Year *uint `json:"year" bson:"year" validate:"nonnilpointer,nonzeropointerelem"` // Hour extracted from the normalized date. // example: 0 // readOnly: true Hour *uint `json:"hour" bson:"hour" validate:"nonnilpointer"` }
Date represents a date optimized for handling multiple time zones, MongoDB pipelines, and query parameter filtering. swagger:model
func NewProcessedDate ¶ added in v1.40.2
func (*Date) GetProcessedDate ¶ added in v1.40.1
func (*Date) Process ¶ added in v1.40.1
Process converts the date to the specified timezone, normalizes to midnight, and converts to UTC.
func (*Date) SetProcessedDate ¶ added in v1.40.1
type DateKey ¶ added in v1.40.1
type DateKey = Key
DateKey represents a key for date-related fields.
type Key ¶ added in v1.39.3
type Key string
Key is an alias for a string.
It is utilized in all embedcup files to represent JSON and BSON keys constants.
type Owner ¶ added in v1.39.2
type Owner struct { // The MongoDB ID of the owner of the document. // example: 5f7b1b9b9b9b9b9b9b9b9b9b // required: true OwnerID *primitive.ObjectID `bson:"owner_id" json:"owner_id" validate:"nonnilpointer,nonzeropointerelem"` }
Owner represents the owner of a document. swagger:model