Documentation
¶
Index ¶
- Variables
- func FieldSlice(t Model) []string
- func StringOf(t Model) (string, error)
- func ValueContains(val any, query string) bool
- type ContainedModel
- type Model
- type Organization
- func (*Organization) Contains() []ContainedModel
- func (*Organization) DocumentType() string
- func (o *Organization) Fields() *orderedmap.OrderedMap[string, int]
- func (o *Organization) String() (string, error)
- func (o *Organization) StringID() string
- func (o *Organization) ValueAt(field string) (any, error)
- func (o *Organization) ValueAtIdx(i int) any
- type Ticket
- func (*Ticket) Contains() []ContainedModel
- func (*Ticket) DocumentType() string
- func (t *Ticket) Fields() *orderedmap.OrderedMap[string, int]
- func (t *Ticket) String() (string, error)
- func (t *Ticket) StringID() string
- func (t *Ticket) ValueAt(field string) (any, error)
- func (t *Ticket) ValueAtIdx(i int) any
- type User
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrFieldNotFound = fmt.Errorf("field not found")
Functions ¶
func FieldSlice ¶
FieldSlice returns a slice of the fields in the Model.
func ValueContains ¶
Types ¶
type ContainedModel ¶
type Model ¶
type Model interface { // StringID is the unique identifier of the Model as a string. StringID() string // DocumentType returns a string representation of the type of the Model. DocumentType() string // Fields returns a the fields in the Model mapped to an index. Fields() *orderedmap.OrderedMap[string, int] // ValueAtIdx returns the value of the field in the Model at i. ValueAtIdx(i int) any // ValueAt returns the value of the field in the Model. // It returns ErrFieldNotFound if the field does not exist. ValueAt(field string) (any, error) // Contains returns a slice of ContainedModels that the Model contains. Contains() []ContainedModel }
func OrganizationSliceToModelsSlice ¶
func OrganizationSliceToModelsSlice(in []Organization) []Model
OrganizationSliceToModelsSlice converts a slice of Organization to a slice of Model.
func TicketSliceToModelsSlice ¶
TicketSliceToModelsSlice converts a slice of Ticket to a slice of Model.
func UserSliceToModelsSlice ¶
UserSliceToModelsSlice converts a slice of User to a slice of Model.
type Organization ¶
type Organization struct { ID int `json:"_id"` URL string `json:"url"` ExternalID uuid.UUID `json:"external_id"` Name string `json:"name"` DomainNames []string `json:"domain_names"` CreatedAt string `json:"created_at"` Details string `json:"details"` Tags []string `json:"tags"` }
func (*Organization) Contains ¶
func (*Organization) Contains() []ContainedModel
func (*Organization) DocumentType ¶
func (*Organization) DocumentType() string
func (*Organization) Fields ¶
func (o *Organization) Fields() *orderedmap.OrderedMap[string, int]
func (*Organization) String ¶
func (o *Organization) String() (string, error)
func (*Organization) StringID ¶
func (o *Organization) StringID() string
func (*Organization) ValueAtIdx ¶
func (o *Organization) ValueAtIdx(i int) any
type Ticket ¶
type Ticket struct { ID uuid.UUID `json:"_id"` URL string `json:"url"` ExternalID uuid.UUID `json:"external_id"` CreatedAt string `json:"created_at"` Type string `json:"type"` Subject string `json:"subject"` Description string `json:"description"` Priority string `json:"priority"` Status string `json:"status"` SubmitterID int `json:"submitter_id"` AssigneeID int `json:"assignee_id"` OrganizationID int `json:"organization_id"` Tags []string `json:"tags"` HasIncidents bool `json:"has_incidents"` DueAt string `json:"due_at"` Via string `json:"via"` }
func (*Ticket) Contains ¶
func (*Ticket) Contains() []ContainedModel
func (*Ticket) DocumentType ¶
func (*Ticket) ValueAtIdx ¶
type User ¶
type User struct { ID int `json:"_id"` URL string `json:"url"` ExternalID uuid.UUID `json:"external_id"` Name string `json:"name"` Alias string `json:"alias"` CreatedAt string `json:"created_at"` Active bool `json:"active"` Verified bool `json:"verified"` Locale string `json:"locale"` Timezone string `json:"timezone"` LastLoginAt string `json:"last_login_at"` Email string `json:"email"` Phone string `json:"phone"` Signature string `json:"signature"` OrganizationID int `json:"organization_id"` Tags []string `json:"tags"` Suspended bool `json:"suspended"` Role string `json:"role"` }
func (*User) Contains ¶
func (*User) Contains() []ContainedModel
func (*User) DocumentType ¶
func (*User) ValueAtIdx ¶
Click to show internal directories.
Click to hide internal directories.