diff --git a/app/action/actionmap.go b/app/action/actionmap.go index e9b3cdef..86c714c0 100644 --- a/app/action/actionmap.go +++ b/app/action/actionmap.go @@ -66,3 +66,9 @@ func ActionFromMap(m util.ValueMap, setPK bool) (*Action, util.ValueMap, error) // $PF_SECTION_END(extrachecks)$ return ret, extra, nil } + +//nolint:lll +func (a *Action) ToOrderedMap() *util.OrderedMap[any] { + pairs := util.OrderedPairs[any]{{K: "id", V: a.ID}, {K: "svc", V: a.Svc}, {K: "modelID", V: a.ModelID}, {K: "userID", V: a.UserID}, {K: "act", V: a.Act}, {K: "content", V: a.Content}, {K: "note", V: a.Note}, {K: "created", V: a.Created}} + return util.NewOrderedMap[any](false, 4, pairs...) +} diff --git a/app/action/actions.go b/app/action/actions.go index 55d9b4f7..113ddb94 100644 --- a/app/action/actions.go +++ b/app/action/actions.go @@ -73,6 +73,18 @@ func (a Actions) GetByUserIDs(userIDs ...uuid.UUID) Actions { }) } +func (a Actions) ToMaps() []util.ValueMap { + return lo.Map(a, func(x *Action, _ int) util.ValueMap { + return x.ToMap() + }) +} + +func (a Actions) ToOrderedMaps() util.OrderedMaps[any] { + return lo.Map(a, func(x *Action, _ int) *util.OrderedMap[any] { + return x.ToOrderedMap() + }) +} + func (a Actions) ToCSV() ([]string, [][]string) { return ActionFieldDescs.Keys(), lo.Map(a, func(x *Action, _ int) []string { return x.Strings() diff --git a/app/comment/commentmap.go b/app/comment/commentmap.go index 77b04660..99a4044b 100644 --- a/app/comment/commentmap.go +++ b/app/comment/commentmap.go @@ -63,3 +63,9 @@ func CommentFromMap(m util.ValueMap, setPK bool) (*Comment, util.ValueMap, error // $PF_SECTION_END(extrachecks)$ return ret, extra, nil } + +//nolint:lll +func (c *Comment) ToOrderedMap() *util.OrderedMap[any] { + pairs := util.OrderedPairs[any]{{K: "id", V: c.ID}, {K: "svc", V: c.Svc}, {K: "modelID", V: c.ModelID}, {K: "userID", V: c.UserID}, {K: "content", V: c.Content}, {K: "html", V: c.HTML}, {K: "created", V: c.Created}} + return util.NewOrderedMap[any](false, 4, pairs...) +} diff --git a/app/comment/comments.go b/app/comment/comments.go index 26a2aa6c..8e16de71 100644 --- a/app/comment/comments.go +++ b/app/comment/comments.go @@ -73,6 +73,18 @@ func (c Comments) GetByUserIDs(userIDs ...uuid.UUID) Comments { }) } +func (c Comments) ToMaps() []util.ValueMap { + return lo.Map(c, func(x *Comment, _ int) util.ValueMap { + return x.ToMap() + }) +} + +func (c Comments) ToOrderedMaps() util.OrderedMaps[any] { + return lo.Map(c, func(x *Comment, _ int) *util.OrderedMap[any] { + return x.ToOrderedMap() + }) +} + func (c Comments) ToCSV() ([]string, [][]string) { return CommentFieldDescs.Keys(), lo.Map(c, func(x *Comment, _ int) []string { return x.Strings() diff --git a/app/email/emailmap.go b/app/email/emailmap.go index 7ef06327..edcd232c 100644 --- a/app/email/emailmap.go +++ b/app/email/emailmap.go @@ -57,3 +57,9 @@ func EmailFromMap(m util.ValueMap, setPK bool) (*Email, util.ValueMap, error) { // $PF_SECTION_END(extrachecks)$ return ret, extra, nil } + +//nolint:lll +func (e *Email) ToOrderedMap() *util.OrderedMap[any] { + pairs := util.OrderedPairs[any]{{K: "id", V: e.ID}, {K: "recipients", V: e.Recipients}, {K: "subject", V: e.Subject}, {K: "data", V: e.Data}, {K: "plain", V: e.Plain}, {K: "html", V: e.HTML}, {K: "userID", V: e.UserID}, {K: "status", V: e.Status}, {K: "created", V: e.Created}} + return util.NewOrderedMap[any](false, 4, pairs...) +} diff --git a/app/email/emails.go b/app/email/emails.go index ec29568f..6ff1f0cc 100644 --- a/app/email/emails.go +++ b/app/email/emails.go @@ -73,6 +73,18 @@ func (e Emails) GetByUserIDs(userIDs ...uuid.UUID) Emails { }) } +func (e Emails) ToMaps() []util.ValueMap { + return lo.Map(e, func(x *Email, _ int) util.ValueMap { + return x.ToMap() + }) +} + +func (e Emails) ToOrderedMaps() util.OrderedMaps[any] { + return lo.Map(e, func(x *Email, _ int) *util.OrderedMap[any] { + return x.ToOrderedMap() + }) +} + func (e Emails) ToCSV() ([]string, [][]string) { return EmailFieldDescs.Keys(), lo.Map(e, func(x *Email, _ int) []string { return x.Strings() diff --git a/app/estimate/ehistory/estimatehistories.go b/app/estimate/ehistory/estimatehistories.go index bd3c5337..2e301202 100644 --- a/app/estimate/ehistory/estimatehistories.go +++ b/app/estimate/ehistory/estimatehistories.go @@ -73,6 +73,18 @@ func (e EstimateHistories) GetByEstimateIDs(estimateIDs ...uuid.UUID) EstimateHi }) } +func (e EstimateHistories) ToMaps() []util.ValueMap { + return lo.Map(e, func(x *EstimateHistory, _ int) util.ValueMap { + return x.ToMap() + }) +} + +func (e EstimateHistories) ToOrderedMaps() util.OrderedMaps[any] { + return lo.Map(e, func(x *EstimateHistory, _ int) *util.OrderedMap[any] { + return x.ToOrderedMap() + }) +} + func (e EstimateHistories) ToCSV() ([]string, [][]string) { return EstimateHistoryFieldDescs.Keys(), lo.Map(e, func(x *EstimateHistory, _ int) []string { return x.Strings() diff --git a/app/estimate/ehistory/estimatehistorymap.go b/app/estimate/ehistory/estimatehistorymap.go index 3f537577..2911b3fe 100644 --- a/app/estimate/ehistory/estimatehistorymap.go +++ b/app/estimate/ehistory/estimatehistorymap.go @@ -37,3 +37,9 @@ func EstimateHistoryFromMap(m util.ValueMap, setPK bool) (*EstimateHistory, util // $PF_SECTION_END(extrachecks)$ return ret, extra, nil } + +//nolint:lll +func (e *EstimateHistory) ToOrderedMap() *util.OrderedMap[any] { + pairs := util.OrderedPairs[any]{{K: "slug", V: e.Slug}, {K: "estimateID", V: e.EstimateID}, {K: "estimateName", V: e.EstimateName}, {K: "created", V: e.Created}} + return util.NewOrderedMap[any](false, 4, pairs...) +} diff --git a/app/estimate/emember/estimatemembermap.go b/app/estimate/emember/estimatemembermap.go index b4b62e65..19ada15f 100644 --- a/app/estimate/emember/estimatemembermap.go +++ b/app/estimate/emember/estimatemembermap.go @@ -57,3 +57,9 @@ func EstimateMemberFromMap(m util.ValueMap, setPK bool) (*EstimateMember, util.V // $PF_SECTION_END(extrachecks)$ return ret, extra, nil } + +//nolint:lll +func (e *EstimateMember) ToOrderedMap() *util.OrderedMap[any] { + pairs := util.OrderedPairs[any]{{K: "estimateID", V: e.EstimateID}, {K: "userID", V: e.UserID}, {K: "name", V: e.Name}, {K: "picture", V: e.Picture}, {K: "role", V: e.Role}, {K: "created", V: e.Created}, {K: "updated", V: e.Updated}} + return util.NewOrderedMap[any](false, 4, pairs...) +} diff --git a/app/estimate/emember/estimatemembers.go b/app/estimate/emember/estimatemembers.go index 998fc2d6..34dd55af 100644 --- a/app/estimate/emember/estimatemembers.go +++ b/app/estimate/emember/estimatemembers.go @@ -90,6 +90,18 @@ func (e EstimateMembers) GetByUserIDs(userIDs ...uuid.UUID) EstimateMembers { }) } +func (e EstimateMembers) ToMaps() []util.ValueMap { + return lo.Map(e, func(x *EstimateMember, _ int) util.ValueMap { + return x.ToMap() + }) +} + +func (e EstimateMembers) ToOrderedMaps() util.OrderedMaps[any] { + return lo.Map(e, func(x *EstimateMember, _ int) *util.OrderedMap[any] { + return x.ToOrderedMap() + }) +} + func (e EstimateMembers) ToCSV() ([]string, [][]string) { return EstimateMemberFieldDescs.Keys(), lo.Map(e, func(x *EstimateMember, _ int) []string { return x.Strings() diff --git a/app/estimate/epermission/estimatepermissionmap.go b/app/estimate/epermission/estimatepermissionmap.go index 53236246..791d4e8e 100644 --- a/app/estimate/epermission/estimatepermissionmap.go +++ b/app/estimate/epermission/estimatepermissionmap.go @@ -43,3 +43,9 @@ func EstimatePermissionFromMap(m util.ValueMap, setPK bool) (*EstimatePermission // $PF_SECTION_END(extrachecks)$ return ret, extra, nil } + +//nolint:lll +func (e *EstimatePermission) ToOrderedMap() *util.OrderedMap[any] { + pairs := util.OrderedPairs[any]{{K: "estimateID", V: e.EstimateID}, {K: "key", V: e.Key}, {K: "value", V: e.Value}, {K: "access", V: e.Access}, {K: "created", V: e.Created}} + return util.NewOrderedMap[any](false, 4, pairs...) +} diff --git a/app/estimate/epermission/estimatepermissions.go b/app/estimate/epermission/estimatepermissions.go index c2a5de96..0b77db70 100644 --- a/app/estimate/epermission/estimatepermissions.go +++ b/app/estimate/epermission/estimatepermissions.go @@ -119,6 +119,18 @@ func (e EstimatePermissions) GetByValues(values ...string) EstimatePermissions { }) } +func (e EstimatePermissions) ToMaps() []util.ValueMap { + return lo.Map(e, func(x *EstimatePermission, _ int) util.ValueMap { + return x.ToMap() + }) +} + +func (e EstimatePermissions) ToOrderedMaps() util.OrderedMaps[any] { + return lo.Map(e, func(x *EstimatePermission, _ int) *util.OrderedMap[any] { + return x.ToOrderedMap() + }) +} + func (e EstimatePermissions) ToCSV() ([]string, [][]string) { return EstimatePermissionFieldDescs.Keys(), lo.Map(e, func(x *EstimatePermission, _ int) []string { return x.Strings() diff --git a/app/estimate/estimatemap.go b/app/estimate/estimatemap.go index fdc20198..3622d73a 100644 --- a/app/estimate/estimatemap.go +++ b/app/estimate/estimatemap.go @@ -58,3 +58,9 @@ func EstimateFromMap(m util.ValueMap, setPK bool) (*Estimate, util.ValueMap, err // $PF_SECTION_END(extrachecks)$ return ret, extra, nil } + +//nolint:lll +func (e *Estimate) ToOrderedMap() *util.OrderedMap[any] { + pairs := util.OrderedPairs[any]{{K: "id", V: e.ID}, {K: "slug", V: e.Slug}, {K: "title", V: e.Title}, {K: "icon", V: e.Icon}, {K: "status", V: e.Status}, {K: "teamID", V: e.TeamID}, {K: "sprintID", V: e.SprintID}, {K: "choices", V: e.Choices}, {K: "created", V: e.Created}, {K: "updated", V: e.Updated}} + return util.NewOrderedMap[any](false, 4, pairs...) +} diff --git a/app/estimate/estimates.go b/app/estimate/estimates.go index ed627abe..429795e3 100644 --- a/app/estimate/estimates.go +++ b/app/estimate/estimates.go @@ -128,6 +128,18 @@ func (e Estimates) GetBySprintIDs(sprintIDs ...*uuid.UUID) Estimates { }) } +func (e Estimates) ToMaps() []util.ValueMap { + return lo.Map(e, func(x *Estimate, _ int) util.ValueMap { + return x.ToMap() + }) +} + +func (e Estimates) ToOrderedMaps() util.OrderedMaps[any] { + return lo.Map(e, func(x *Estimate, _ int) *util.OrderedMap[any] { + return x.ToOrderedMap() + }) +} + func (e Estimates) ToCSV() ([]string, [][]string) { return EstimateFieldDescs.Keys(), lo.Map(e, func(x *Estimate, _ int) []string { return x.Strings() diff --git a/app/estimate/story/stories.go b/app/estimate/story/stories.go index b456b115..d812fd10 100644 --- a/app/estimate/story/stories.go +++ b/app/estimate/story/stories.go @@ -91,6 +91,18 @@ func (s Stories) GetByUserIDs(userIDs ...uuid.UUID) Stories { }) } +func (s Stories) ToMaps() []util.ValueMap { + return lo.Map(s, func(x *Story, _ int) util.ValueMap { + return x.ToMap() + }) +} + +func (s Stories) ToOrderedMaps() util.OrderedMaps[any] { + return lo.Map(s, func(x *Story, _ int) *util.OrderedMap[any] { + return x.ToOrderedMap() + }) +} + func (s Stories) ToCSV() ([]string, [][]string) { return StoryFieldDescs.Keys(), lo.Map(s, func(x *Story, _ int) []string { return x.Strings() diff --git a/app/estimate/story/storymap.go b/app/estimate/story/storymap.go index 9af06601..4f1abe42 100644 --- a/app/estimate/story/storymap.go +++ b/app/estimate/story/storymap.go @@ -66,3 +66,9 @@ func StoryFromMap(m util.ValueMap, setPK bool) (*Story, util.ValueMap, error) { // $PF_SECTION_END(extrachecks)$ return ret, extra, nil } + +//nolint:lll +func (s *Story) ToOrderedMap() *util.OrderedMap[any] { + pairs := util.OrderedPairs[any]{{K: "id", V: s.ID}, {K: "estimateID", V: s.EstimateID}, {K: "idx", V: s.Idx}, {K: "userID", V: s.UserID}, {K: "title", V: s.Title}, {K: "status", V: s.Status}, {K: "finalVote", V: s.FinalVote}, {K: "created", V: s.Created}, {K: "updated", V: s.Updated}} + return util.NewOrderedMap[any](false, 4, pairs...) +} diff --git a/app/estimate/story/vote/votemap.go b/app/estimate/story/vote/votemap.go index 974a0f91..e6c4e411 100644 --- a/app/estimate/story/vote/votemap.go +++ b/app/estimate/story/vote/votemap.go @@ -45,3 +45,9 @@ func VoteFromMap(m util.ValueMap, setPK bool) (*Vote, util.ValueMap, error) { // $PF_SECTION_END(extrachecks)$ return ret, extra, nil } + +//nolint:lll +func (v *Vote) ToOrderedMap() *util.OrderedMap[any] { + pairs := util.OrderedPairs[any]{{K: "storyID", V: v.StoryID}, {K: "userID", V: v.UserID}, {K: "choice", V: v.Choice}, {K: "created", V: v.Created}, {K: "updated", V: v.Updated}} + return util.NewOrderedMap[any](false, 4, pairs...) +} diff --git a/app/estimate/story/vote/votes.go b/app/estimate/story/vote/votes.go index 45cbda2c..b7885512 100644 --- a/app/estimate/story/vote/votes.go +++ b/app/estimate/story/vote/votes.go @@ -90,6 +90,18 @@ func (v Votes) GetByUserIDs(userIDs ...uuid.UUID) Votes { }) } +func (v Votes) ToMaps() []util.ValueMap { + return lo.Map(v, func(x *Vote, _ int) util.ValueMap { + return x.ToMap() + }) +} + +func (v Votes) ToOrderedMaps() util.OrderedMaps[any] { + return lo.Map(v, func(x *Vote, _ int) *util.OrderedMap[any] { + return x.ToOrderedMap() + }) +} + func (v Votes) ToCSV() ([]string, [][]string) { return VoteFieldDescs.Keys(), lo.Map(v, func(x *Vote, _ int) []string { return x.Strings() diff --git a/app/lib/filesystem/zip.go b/app/lib/filesystem/zip.go index e60e80cc..b4f38eb6 100644 --- a/app/lib/filesystem/zip.go +++ b/app/lib/filesystem/zip.go @@ -72,7 +72,7 @@ func (f *FileSystem) UnzipToDir(src string, dest string) (*util.OrderedMap[int64 if err != nil { return nil, err } - ret.Append(f.Name, fsz) + ret.Set(f.Name, fsz) } return ret, nil } diff --git a/app/retro/feedback/feedbackmap.go b/app/retro/feedback/feedbackmap.go index 7242961c..bb02c039 100644 --- a/app/retro/feedback/feedbackmap.go +++ b/app/retro/feedback/feedbackmap.go @@ -58,3 +58,9 @@ func FeedbackFromMap(m util.ValueMap, setPK bool) (*Feedback, util.ValueMap, err // $PF_SECTION_END(extrachecks)$ return ret, extra, nil } + +//nolint:lll +func (f *Feedback) ToOrderedMap() *util.OrderedMap[any] { + pairs := util.OrderedPairs[any]{{K: "id", V: f.ID}, {K: "retroID", V: f.RetroID}, {K: "idx", V: f.Idx}, {K: "userID", V: f.UserID}, {K: "category", V: f.Category}, {K: "content", V: f.Content}, {K: "html", V: f.HTML}, {K: "created", V: f.Created}, {K: "updated", V: f.Updated}} + return util.NewOrderedMap[any](false, 4, pairs...) +} diff --git a/app/retro/feedback/feedbacks.go b/app/retro/feedback/feedbacks.go index d18c2365..af68779d 100644 --- a/app/retro/feedback/feedbacks.go +++ b/app/retro/feedback/feedbacks.go @@ -91,6 +91,18 @@ func (f Feedbacks) GetByUserIDs(userIDs ...uuid.UUID) Feedbacks { }) } +func (f Feedbacks) ToMaps() []util.ValueMap { + return lo.Map(f, func(x *Feedback, _ int) util.ValueMap { + return x.ToMap() + }) +} + +func (f Feedbacks) ToOrderedMaps() util.OrderedMaps[any] { + return lo.Map(f, func(x *Feedback, _ int) *util.OrderedMap[any] { + return x.ToOrderedMap() + }) +} + func (f Feedbacks) ToCSV() ([]string, [][]string) { return FeedbackFieldDescs.Keys(), lo.Map(f, func(x *Feedback, _ int) []string { return x.Strings() diff --git a/app/retro/retromap.go b/app/retro/retromap.go index e7a4ac3d..71b6bf9d 100644 --- a/app/retro/retromap.go +++ b/app/retro/retromap.go @@ -58,3 +58,9 @@ func RetroFromMap(m util.ValueMap, setPK bool) (*Retro, util.ValueMap, error) { // $PF_SECTION_END(extrachecks)$ return ret, extra, nil } + +//nolint:lll +func (r *Retro) ToOrderedMap() *util.OrderedMap[any] { + pairs := util.OrderedPairs[any]{{K: "id", V: r.ID}, {K: "slug", V: r.Slug}, {K: "title", V: r.Title}, {K: "icon", V: r.Icon}, {K: "status", V: r.Status}, {K: "teamID", V: r.TeamID}, {K: "sprintID", V: r.SprintID}, {K: "categories", V: r.Categories}, {K: "created", V: r.Created}, {K: "updated", V: r.Updated}} + return util.NewOrderedMap[any](false, 4, pairs...) +} diff --git a/app/retro/retros.go b/app/retro/retros.go index 8ffee57d..81ad2854 100644 --- a/app/retro/retros.go +++ b/app/retro/retros.go @@ -128,6 +128,18 @@ func (r Retros) GetBySprintIDs(sprintIDs ...*uuid.UUID) Retros { }) } +func (r Retros) ToMaps() []util.ValueMap { + return lo.Map(r, func(x *Retro, _ int) util.ValueMap { + return x.ToMap() + }) +} + +func (r Retros) ToOrderedMaps() util.OrderedMaps[any] { + return lo.Map(r, func(x *Retro, _ int) *util.OrderedMap[any] { + return x.ToOrderedMap() + }) +} + func (r Retros) ToCSV() ([]string, [][]string) { return RetroFieldDescs.Keys(), lo.Map(r, func(x *Retro, _ int) []string { return x.Strings() diff --git a/app/retro/rhistory/retrohistories.go b/app/retro/rhistory/retrohistories.go index 532d2c84..a7a6aa28 100644 --- a/app/retro/rhistory/retrohistories.go +++ b/app/retro/rhistory/retrohistories.go @@ -73,6 +73,18 @@ func (r RetroHistories) GetByRetroIDs(retroIDs ...uuid.UUID) RetroHistories { }) } +func (r RetroHistories) ToMaps() []util.ValueMap { + return lo.Map(r, func(x *RetroHistory, _ int) util.ValueMap { + return x.ToMap() + }) +} + +func (r RetroHistories) ToOrderedMaps() util.OrderedMaps[any] { + return lo.Map(r, func(x *RetroHistory, _ int) *util.OrderedMap[any] { + return x.ToOrderedMap() + }) +} + func (r RetroHistories) ToCSV() ([]string, [][]string) { return RetroHistoryFieldDescs.Keys(), lo.Map(r, func(x *RetroHistory, _ int) []string { return x.Strings() diff --git a/app/retro/rhistory/retrohistorymap.go b/app/retro/rhistory/retrohistorymap.go index 92b84fad..7f503326 100644 --- a/app/retro/rhistory/retrohistorymap.go +++ b/app/retro/rhistory/retrohistorymap.go @@ -37,3 +37,8 @@ func RetroHistoryFromMap(m util.ValueMap, setPK bool) (*RetroHistory, util.Value // $PF_SECTION_END(extrachecks)$ return ret, extra, nil } + +func (r *RetroHistory) ToOrderedMap() *util.OrderedMap[any] { + pairs := util.OrderedPairs[any]{{K: "slug", V: r.Slug}, {K: "retroID", V: r.RetroID}, {K: "retroName", V: r.RetroName}, {K: "created", V: r.Created}} + return util.NewOrderedMap[any](false, 4, pairs...) +} diff --git a/app/retro/rmember/retromembermap.go b/app/retro/rmember/retromembermap.go index cf3f3130..921c2d1b 100644 --- a/app/retro/rmember/retromembermap.go +++ b/app/retro/rmember/retromembermap.go @@ -57,3 +57,9 @@ func RetroMemberFromMap(m util.ValueMap, setPK bool) (*RetroMember, util.ValueMa // $PF_SECTION_END(extrachecks)$ return ret, extra, nil } + +//nolint:lll +func (r *RetroMember) ToOrderedMap() *util.OrderedMap[any] { + pairs := util.OrderedPairs[any]{{K: "retroID", V: r.RetroID}, {K: "userID", V: r.UserID}, {K: "name", V: r.Name}, {K: "picture", V: r.Picture}, {K: "role", V: r.Role}, {K: "created", V: r.Created}, {K: "updated", V: r.Updated}} + return util.NewOrderedMap[any](false, 4, pairs...) +} diff --git a/app/retro/rmember/retromembers.go b/app/retro/rmember/retromembers.go index 5597096a..d929255d 100644 --- a/app/retro/rmember/retromembers.go +++ b/app/retro/rmember/retromembers.go @@ -90,6 +90,18 @@ func (r RetroMembers) GetByUserIDs(userIDs ...uuid.UUID) RetroMembers { }) } +func (r RetroMembers) ToMaps() []util.ValueMap { + return lo.Map(r, func(x *RetroMember, _ int) util.ValueMap { + return x.ToMap() + }) +} + +func (r RetroMembers) ToOrderedMaps() util.OrderedMaps[any] { + return lo.Map(r, func(x *RetroMember, _ int) *util.OrderedMap[any] { + return x.ToOrderedMap() + }) +} + func (r RetroMembers) ToCSV() ([]string, [][]string) { return RetroMemberFieldDescs.Keys(), lo.Map(r, func(x *RetroMember, _ int) []string { return x.Strings() diff --git a/app/retro/rpermission/retropermissionmap.go b/app/retro/rpermission/retropermissionmap.go index 7121d74b..d7ec3ebc 100644 --- a/app/retro/rpermission/retropermissionmap.go +++ b/app/retro/rpermission/retropermissionmap.go @@ -43,3 +43,9 @@ func RetroPermissionFromMap(m util.ValueMap, setPK bool) (*RetroPermission, util // $PF_SECTION_END(extrachecks)$ return ret, extra, nil } + +//nolint:lll +func (r *RetroPermission) ToOrderedMap() *util.OrderedMap[any] { + pairs := util.OrderedPairs[any]{{K: "retroID", V: r.RetroID}, {K: "key", V: r.Key}, {K: "value", V: r.Value}, {K: "access", V: r.Access}, {K: "created", V: r.Created}} + return util.NewOrderedMap[any](false, 4, pairs...) +} diff --git a/app/retro/rpermission/retropermissions.go b/app/retro/rpermission/retropermissions.go index 8fc22289..17808a2c 100644 --- a/app/retro/rpermission/retropermissions.go +++ b/app/retro/rpermission/retropermissions.go @@ -119,6 +119,18 @@ func (r RetroPermissions) GetByValues(values ...string) RetroPermissions { }) } +func (r RetroPermissions) ToMaps() []util.ValueMap { + return lo.Map(r, func(x *RetroPermission, _ int) util.ValueMap { + return x.ToMap() + }) +} + +func (r RetroPermissions) ToOrderedMaps() util.OrderedMaps[any] { + return lo.Map(r, func(x *RetroPermission, _ int) *util.OrderedMap[any] { + return x.ToOrderedMap() + }) +} + func (r RetroPermissions) ToCSV() ([]string, [][]string) { return RetroPermissionFieldDescs.Keys(), lo.Map(r, func(x *RetroPermission, _ int) []string { return x.Strings() diff --git a/app/sprint/shistory/sprinthistories.go b/app/sprint/shistory/sprinthistories.go index 5e3e1a48..7e3818d1 100644 --- a/app/sprint/shistory/sprinthistories.go +++ b/app/sprint/shistory/sprinthistories.go @@ -73,6 +73,18 @@ func (s SprintHistories) GetBySprintIDs(sprintIDs ...uuid.UUID) SprintHistories }) } +func (s SprintHistories) ToMaps() []util.ValueMap { + return lo.Map(s, func(x *SprintHistory, _ int) util.ValueMap { + return x.ToMap() + }) +} + +func (s SprintHistories) ToOrderedMaps() util.OrderedMaps[any] { + return lo.Map(s, func(x *SprintHistory, _ int) *util.OrderedMap[any] { + return x.ToOrderedMap() + }) +} + func (s SprintHistories) ToCSV() ([]string, [][]string) { return SprintHistoryFieldDescs.Keys(), lo.Map(s, func(x *SprintHistory, _ int) []string { return x.Strings() diff --git a/app/sprint/shistory/sprinthistorymap.go b/app/sprint/shistory/sprinthistorymap.go index 8d411a24..8308614b 100644 --- a/app/sprint/shistory/sprinthistorymap.go +++ b/app/sprint/shistory/sprinthistorymap.go @@ -37,3 +37,8 @@ func SprintHistoryFromMap(m util.ValueMap, setPK bool) (*SprintHistory, util.Val // $PF_SECTION_END(extrachecks)$ return ret, extra, nil } + +func (s *SprintHistory) ToOrderedMap() *util.OrderedMap[any] { + pairs := util.OrderedPairs[any]{{K: "slug", V: s.Slug}, {K: "sprintID", V: s.SprintID}, {K: "sprintName", V: s.SprintName}, {K: "created", V: s.Created}} + return util.NewOrderedMap[any](false, 4, pairs...) +} diff --git a/app/sprint/smember/sprintmembermap.go b/app/sprint/smember/sprintmembermap.go index 4a6ecb6b..63e51393 100644 --- a/app/sprint/smember/sprintmembermap.go +++ b/app/sprint/smember/sprintmembermap.go @@ -57,3 +57,9 @@ func SprintMemberFromMap(m util.ValueMap, setPK bool) (*SprintMember, util.Value // $PF_SECTION_END(extrachecks)$ return ret, extra, nil } + +//nolint:lll +func (s *SprintMember) ToOrderedMap() *util.OrderedMap[any] { + pairs := util.OrderedPairs[any]{{K: "sprintID", V: s.SprintID}, {K: "userID", V: s.UserID}, {K: "name", V: s.Name}, {K: "picture", V: s.Picture}, {K: "role", V: s.Role}, {K: "created", V: s.Created}, {K: "updated", V: s.Updated}} + return util.NewOrderedMap[any](false, 4, pairs...) +} diff --git a/app/sprint/smember/sprintmembers.go b/app/sprint/smember/sprintmembers.go index 7150fce3..d40b1719 100644 --- a/app/sprint/smember/sprintmembers.go +++ b/app/sprint/smember/sprintmembers.go @@ -90,6 +90,18 @@ func (s SprintMembers) GetByUserIDs(userIDs ...uuid.UUID) SprintMembers { }) } +func (s SprintMembers) ToMaps() []util.ValueMap { + return lo.Map(s, func(x *SprintMember, _ int) util.ValueMap { + return x.ToMap() + }) +} + +func (s SprintMembers) ToOrderedMaps() util.OrderedMaps[any] { + return lo.Map(s, func(x *SprintMember, _ int) *util.OrderedMap[any] { + return x.ToOrderedMap() + }) +} + func (s SprintMembers) ToCSV() ([]string, [][]string) { return SprintMemberFieldDescs.Keys(), lo.Map(s, func(x *SprintMember, _ int) []string { return x.Strings() diff --git a/app/sprint/spermission/sprintpermissionmap.go b/app/sprint/spermission/sprintpermissionmap.go index abc73ac8..531bce7d 100644 --- a/app/sprint/spermission/sprintpermissionmap.go +++ b/app/sprint/spermission/sprintpermissionmap.go @@ -43,3 +43,9 @@ func SprintPermissionFromMap(m util.ValueMap, setPK bool) (*SprintPermission, ut // $PF_SECTION_END(extrachecks)$ return ret, extra, nil } + +//nolint:lll +func (s *SprintPermission) ToOrderedMap() *util.OrderedMap[any] { + pairs := util.OrderedPairs[any]{{K: "sprintID", V: s.SprintID}, {K: "key", V: s.Key}, {K: "value", V: s.Value}, {K: "access", V: s.Access}, {K: "created", V: s.Created}} + return util.NewOrderedMap[any](false, 4, pairs...) +} diff --git a/app/sprint/spermission/sprintpermissions.go b/app/sprint/spermission/sprintpermissions.go index 2c03a54c..929942dc 100644 --- a/app/sprint/spermission/sprintpermissions.go +++ b/app/sprint/spermission/sprintpermissions.go @@ -119,6 +119,18 @@ func (s SprintPermissions) GetByValues(values ...string) SprintPermissions { }) } +func (s SprintPermissions) ToMaps() []util.ValueMap { + return lo.Map(s, func(x *SprintPermission, _ int) util.ValueMap { + return x.ToMap() + }) +} + +func (s SprintPermissions) ToOrderedMaps() util.OrderedMaps[any] { + return lo.Map(s, func(x *SprintPermission, _ int) *util.OrderedMap[any] { + return x.ToOrderedMap() + }) +} + func (s SprintPermissions) ToCSV() ([]string, [][]string) { return SprintPermissionFieldDescs.Keys(), lo.Map(s, func(x *SprintPermission, _ int) []string { return x.Strings() diff --git a/app/sprint/sprintmap.go b/app/sprint/sprintmap.go index 5bec2a32..96f61de6 100644 --- a/app/sprint/sprintmap.go +++ b/app/sprint/sprintmap.go @@ -55,3 +55,9 @@ func SprintFromMap(m util.ValueMap, setPK bool) (*Sprint, util.ValueMap, error) // $PF_SECTION_END(extrachecks)$ return ret, extra, nil } + +//nolint:lll +func (s *Sprint) ToOrderedMap() *util.OrderedMap[any] { + pairs := util.OrderedPairs[any]{{K: "id", V: s.ID}, {K: "slug", V: s.Slug}, {K: "title", V: s.Title}, {K: "icon", V: s.Icon}, {K: "status", V: s.Status}, {K: "teamID", V: s.TeamID}, {K: "startDate", V: s.StartDate}, {K: "endDate", V: s.EndDate}, {K: "created", V: s.Created}, {K: "updated", V: s.Updated}} + return util.NewOrderedMap[any](false, 4, pairs...) +} diff --git a/app/sprint/sprints.go b/app/sprint/sprints.go index 17cad134..6957f3c9 100644 --- a/app/sprint/sprints.go +++ b/app/sprint/sprints.go @@ -110,6 +110,18 @@ func (s Sprints) GetByTeamIDs(teamIDs ...*uuid.UUID) Sprints { }) } +func (s Sprints) ToMaps() []util.ValueMap { + return lo.Map(s, func(x *Sprint, _ int) util.ValueMap { + return x.ToMap() + }) +} + +func (s Sprints) ToOrderedMaps() util.OrderedMaps[any] { + return lo.Map(s, func(x *Sprint, _ int) *util.OrderedMap[any] { + return x.ToOrderedMap() + }) +} + func (s Sprints) ToCSV() ([]string, [][]string) { return SprintFieldDescs.Keys(), lo.Map(s, func(x *Sprint, _ int) []string { return x.Strings() diff --git a/app/standup/report/reportmap.go b/app/standup/report/reportmap.go index 531e3e9f..25444f8b 100644 --- a/app/standup/report/reportmap.go +++ b/app/standup/report/reportmap.go @@ -63,3 +63,9 @@ func ReportFromMap(m util.ValueMap, setPK bool) (*Report, util.ValueMap, error) // $PF_SECTION_END(extrachecks)$ return ret, extra, nil } + +//nolint:lll +func (r *Report) ToOrderedMap() *util.OrderedMap[any] { + pairs := util.OrderedPairs[any]{{K: "id", V: r.ID}, {K: "standupID", V: r.StandupID}, {K: "day", V: r.Day}, {K: "userID", V: r.UserID}, {K: "content", V: r.Content}, {K: "html", V: r.HTML}, {K: "created", V: r.Created}, {K: "updated", V: r.Updated}} + return util.NewOrderedMap[any](false, 4, pairs...) +} diff --git a/app/standup/report/reports.go b/app/standup/report/reports.go index 905bfe33..a5801978 100644 --- a/app/standup/report/reports.go +++ b/app/standup/report/reports.go @@ -91,6 +91,18 @@ func (r Reports) GetByUserIDs(userIDs ...uuid.UUID) Reports { }) } +func (r Reports) ToMaps() []util.ValueMap { + return lo.Map(r, func(x *Report, _ int) util.ValueMap { + return x.ToMap() + }) +} + +func (r Reports) ToOrderedMaps() util.OrderedMaps[any] { + return lo.Map(r, func(x *Report, _ int) *util.OrderedMap[any] { + return x.ToOrderedMap() + }) +} + func (r Reports) ToCSV() ([]string, [][]string) { return ReportFieldDescs.Keys(), lo.Map(r, func(x *Report, _ int) []string { return x.Strings() diff --git a/app/standup/standupmap.go b/app/standup/standupmap.go index 8fe26a8f..08e4e995 100644 --- a/app/standup/standupmap.go +++ b/app/standup/standupmap.go @@ -53,3 +53,9 @@ func StandupFromMap(m util.ValueMap, setPK bool) (*Standup, util.ValueMap, error // $PF_SECTION_END(extrachecks)$ return ret, extra, nil } + +//nolint:lll +func (s *Standup) ToOrderedMap() *util.OrderedMap[any] { + pairs := util.OrderedPairs[any]{{K: "id", V: s.ID}, {K: "slug", V: s.Slug}, {K: "title", V: s.Title}, {K: "icon", V: s.Icon}, {K: "status", V: s.Status}, {K: "teamID", V: s.TeamID}, {K: "sprintID", V: s.SprintID}, {K: "created", V: s.Created}, {K: "updated", V: s.Updated}} + return util.NewOrderedMap[any](false, 4, pairs...) +} diff --git a/app/standup/standups.go b/app/standup/standups.go index a3fa7475..2c5623fa 100644 --- a/app/standup/standups.go +++ b/app/standup/standups.go @@ -128,6 +128,18 @@ func (s Standups) GetBySprintIDs(sprintIDs ...*uuid.UUID) Standups { }) } +func (s Standups) ToMaps() []util.ValueMap { + return lo.Map(s, func(x *Standup, _ int) util.ValueMap { + return x.ToMap() + }) +} + +func (s Standups) ToOrderedMaps() util.OrderedMaps[any] { + return lo.Map(s, func(x *Standup, _ int) *util.OrderedMap[any] { + return x.ToOrderedMap() + }) +} + func (s Standups) ToCSV() ([]string, [][]string) { return StandupFieldDescs.Keys(), lo.Map(s, func(x *Standup, _ int) []string { return x.Strings() diff --git a/app/standup/uhistory/standuphistories.go b/app/standup/uhistory/standuphistories.go index ba24c911..2db09238 100644 --- a/app/standup/uhistory/standuphistories.go +++ b/app/standup/uhistory/standuphistories.go @@ -73,6 +73,18 @@ func (s StandupHistories) GetByStandupIDs(standupIDs ...uuid.UUID) StandupHistor }) } +func (s StandupHistories) ToMaps() []util.ValueMap { + return lo.Map(s, func(x *StandupHistory, _ int) util.ValueMap { + return x.ToMap() + }) +} + +func (s StandupHistories) ToOrderedMaps() util.OrderedMaps[any] { + return lo.Map(s, func(x *StandupHistory, _ int) *util.OrderedMap[any] { + return x.ToOrderedMap() + }) +} + func (s StandupHistories) ToCSV() ([]string, [][]string) { return StandupHistoryFieldDescs.Keys(), lo.Map(s, func(x *StandupHistory, _ int) []string { return x.Strings() diff --git a/app/standup/uhistory/standuphistorymap.go b/app/standup/uhistory/standuphistorymap.go index 75a9a6e5..916399bc 100644 --- a/app/standup/uhistory/standuphistorymap.go +++ b/app/standup/uhistory/standuphistorymap.go @@ -37,3 +37,8 @@ func StandupHistoryFromMap(m util.ValueMap, setPK bool) (*StandupHistory, util.V // $PF_SECTION_END(extrachecks)$ return ret, extra, nil } + +func (s *StandupHistory) ToOrderedMap() *util.OrderedMap[any] { + pairs := util.OrderedPairs[any]{{K: "slug", V: s.Slug}, {K: "standupID", V: s.StandupID}, {K: "standupName", V: s.StandupName}, {K: "created", V: s.Created}} + return util.NewOrderedMap[any](false, 4, pairs...) +} diff --git a/app/standup/umember/standupmembermap.go b/app/standup/umember/standupmembermap.go index 310eb9a2..d777f801 100644 --- a/app/standup/umember/standupmembermap.go +++ b/app/standup/umember/standupmembermap.go @@ -57,3 +57,9 @@ func StandupMemberFromMap(m util.ValueMap, setPK bool) (*StandupMember, util.Val // $PF_SECTION_END(extrachecks)$ return ret, extra, nil } + +//nolint:lll +func (s *StandupMember) ToOrderedMap() *util.OrderedMap[any] { + pairs := util.OrderedPairs[any]{{K: "standupID", V: s.StandupID}, {K: "userID", V: s.UserID}, {K: "name", V: s.Name}, {K: "picture", V: s.Picture}, {K: "role", V: s.Role}, {K: "created", V: s.Created}, {K: "updated", V: s.Updated}} + return util.NewOrderedMap[any](false, 4, pairs...) +} diff --git a/app/standup/umember/standupmembers.go b/app/standup/umember/standupmembers.go index e37997f1..3599f337 100644 --- a/app/standup/umember/standupmembers.go +++ b/app/standup/umember/standupmembers.go @@ -90,6 +90,18 @@ func (s StandupMembers) GetByUserIDs(userIDs ...uuid.UUID) StandupMembers { }) } +func (s StandupMembers) ToMaps() []util.ValueMap { + return lo.Map(s, func(x *StandupMember, _ int) util.ValueMap { + return x.ToMap() + }) +} + +func (s StandupMembers) ToOrderedMaps() util.OrderedMaps[any] { + return lo.Map(s, func(x *StandupMember, _ int) *util.OrderedMap[any] { + return x.ToOrderedMap() + }) +} + func (s StandupMembers) ToCSV() ([]string, [][]string) { return StandupMemberFieldDescs.Keys(), lo.Map(s, func(x *StandupMember, _ int) []string { return x.Strings() diff --git a/app/standup/upermission/standuppermissionmap.go b/app/standup/upermission/standuppermissionmap.go index 21b42b3a..ada20ea4 100644 --- a/app/standup/upermission/standuppermissionmap.go +++ b/app/standup/upermission/standuppermissionmap.go @@ -43,3 +43,9 @@ func StandupPermissionFromMap(m util.ValueMap, setPK bool) (*StandupPermission, // $PF_SECTION_END(extrachecks)$ return ret, extra, nil } + +//nolint:lll +func (s *StandupPermission) ToOrderedMap() *util.OrderedMap[any] { + pairs := util.OrderedPairs[any]{{K: "standupID", V: s.StandupID}, {K: "key", V: s.Key}, {K: "value", V: s.Value}, {K: "access", V: s.Access}, {K: "created", V: s.Created}} + return util.NewOrderedMap[any](false, 4, pairs...) +} diff --git a/app/standup/upermission/standuppermissions.go b/app/standup/upermission/standuppermissions.go index 3501ed9d..fa1752a5 100644 --- a/app/standup/upermission/standuppermissions.go +++ b/app/standup/upermission/standuppermissions.go @@ -119,6 +119,18 @@ func (s StandupPermissions) GetByValues(values ...string) StandupPermissions { }) } +func (s StandupPermissions) ToMaps() []util.ValueMap { + return lo.Map(s, func(x *StandupPermission, _ int) util.ValueMap { + return x.ToMap() + }) +} + +func (s StandupPermissions) ToOrderedMaps() util.OrderedMaps[any] { + return lo.Map(s, func(x *StandupPermission, _ int) *util.OrderedMap[any] { + return x.ToOrderedMap() + }) +} + func (s StandupPermissions) ToCSV() ([]string, [][]string) { return StandupPermissionFieldDescs.Keys(), lo.Map(s, func(x *StandupPermission, _ int) []string { return x.Strings() diff --git a/app/team/teammap.go b/app/team/teammap.go index f1c1f578..8595145d 100644 --- a/app/team/teammap.go +++ b/app/team/teammap.go @@ -48,3 +48,9 @@ func TeamFromMap(m util.ValueMap, setPK bool) (*Team, util.ValueMap, error) { // $PF_SECTION_END(extrachecks)$ return ret, extra, nil } + +//nolint:lll +func (t *Team) ToOrderedMap() *util.OrderedMap[any] { + pairs := util.OrderedPairs[any]{{K: "id", V: t.ID}, {K: "slug", V: t.Slug}, {K: "title", V: t.Title}, {K: "icon", V: t.Icon}, {K: "status", V: t.Status}, {K: "created", V: t.Created}, {K: "updated", V: t.Updated}} + return util.NewOrderedMap[any](false, 4, pairs...) +} diff --git a/app/team/teams.go b/app/team/teams.go index d7ee7ee7..8849c548 100644 --- a/app/team/teams.go +++ b/app/team/teams.go @@ -92,6 +92,18 @@ func (t Teams) GetByStatuses(statuses ...enum.SessionStatus) Teams { }) } +func (t Teams) ToMaps() []util.ValueMap { + return lo.Map(t, func(x *Team, _ int) util.ValueMap { + return x.ToMap() + }) +} + +func (t Teams) ToOrderedMaps() util.OrderedMaps[any] { + return lo.Map(t, func(x *Team, _ int) *util.OrderedMap[any] { + return x.ToOrderedMap() + }) +} + func (t Teams) ToCSV() ([]string, [][]string) { return TeamFieldDescs.Keys(), lo.Map(t, func(x *Team, _ int) []string { return x.Strings() diff --git a/app/team/thistory/teamhistories.go b/app/team/thistory/teamhistories.go index 52356875..712bf7c3 100644 --- a/app/team/thistory/teamhistories.go +++ b/app/team/thistory/teamhistories.go @@ -73,6 +73,18 @@ func (t TeamHistories) GetByTeamIDs(teamIDs ...uuid.UUID) TeamHistories { }) } +func (t TeamHistories) ToMaps() []util.ValueMap { + return lo.Map(t, func(x *TeamHistory, _ int) util.ValueMap { + return x.ToMap() + }) +} + +func (t TeamHistories) ToOrderedMaps() util.OrderedMaps[any] { + return lo.Map(t, func(x *TeamHistory, _ int) *util.OrderedMap[any] { + return x.ToOrderedMap() + }) +} + func (t TeamHistories) ToCSV() ([]string, [][]string) { return TeamHistoryFieldDescs.Keys(), lo.Map(t, func(x *TeamHistory, _ int) []string { return x.Strings() diff --git a/app/team/thistory/teamhistorymap.go b/app/team/thistory/teamhistorymap.go index f1eb7bf6..5cf584c1 100644 --- a/app/team/thistory/teamhistorymap.go +++ b/app/team/thistory/teamhistorymap.go @@ -37,3 +37,8 @@ func TeamHistoryFromMap(m util.ValueMap, setPK bool) (*TeamHistory, util.ValueMa // $PF_SECTION_END(extrachecks)$ return ret, extra, nil } + +func (t *TeamHistory) ToOrderedMap() *util.OrderedMap[any] { + pairs := util.OrderedPairs[any]{{K: "slug", V: t.Slug}, {K: "teamID", V: t.TeamID}, {K: "teamName", V: t.TeamName}, {K: "created", V: t.Created}} + return util.NewOrderedMap[any](false, 4, pairs...) +} diff --git a/app/team/tmember/teammembermap.go b/app/team/tmember/teammembermap.go index 141d9dd5..9d0ca157 100644 --- a/app/team/tmember/teammembermap.go +++ b/app/team/tmember/teammembermap.go @@ -56,3 +56,9 @@ func TeamMemberFromMap(m util.ValueMap, setPK bool) (*TeamMember, util.ValueMap, // $PF_SECTION_END(extrachecks)$ return ret, extra, nil } + +//nolint:lll +func (t *TeamMember) ToOrderedMap() *util.OrderedMap[any] { + pairs := util.OrderedPairs[any]{{K: "teamID", V: t.TeamID}, {K: "userID", V: t.UserID}, {K: "name", V: t.Name}, {K: "picture", V: t.Picture}, {K: "role", V: t.Role}, {K: "created", V: t.Created}, {K: "updated", V: t.Updated}} + return util.NewOrderedMap[any](false, 4, pairs...) +} diff --git a/app/team/tmember/teammembers.go b/app/team/tmember/teammembers.go index da4b1d6a..50244292 100644 --- a/app/team/tmember/teammembers.go +++ b/app/team/tmember/teammembers.go @@ -90,6 +90,18 @@ func (t TeamMembers) GetByUserIDs(userIDs ...uuid.UUID) TeamMembers { }) } +func (t TeamMembers) ToMaps() []util.ValueMap { + return lo.Map(t, func(x *TeamMember, _ int) util.ValueMap { + return x.ToMap() + }) +} + +func (t TeamMembers) ToOrderedMaps() util.OrderedMaps[any] { + return lo.Map(t, func(x *TeamMember, _ int) *util.OrderedMap[any] { + return x.ToOrderedMap() + }) +} + func (t TeamMembers) ToCSV() ([]string, [][]string) { return TeamMemberFieldDescs.Keys(), lo.Map(t, func(x *TeamMember, _ int) []string { return x.Strings() diff --git a/app/team/tpermission/teampermissionmap.go b/app/team/tpermission/teampermissionmap.go index 285be144..2fcaf596 100644 --- a/app/team/tpermission/teampermissionmap.go +++ b/app/team/tpermission/teampermissionmap.go @@ -43,3 +43,9 @@ func TeamPermissionFromMap(m util.ValueMap, setPK bool) (*TeamPermission, util.V // $PF_SECTION_END(extrachecks)$ return ret, extra, nil } + +//nolint:lll +func (t *TeamPermission) ToOrderedMap() *util.OrderedMap[any] { + pairs := util.OrderedPairs[any]{{K: "teamID", V: t.TeamID}, {K: "key", V: t.Key}, {K: "value", V: t.Value}, {K: "access", V: t.Access}, {K: "created", V: t.Created}} + return util.NewOrderedMap[any](false, 4, pairs...) +} diff --git a/app/team/tpermission/teampermissions.go b/app/team/tpermission/teampermissions.go index 5bfde42a..d7c99e58 100644 --- a/app/team/tpermission/teampermissions.go +++ b/app/team/tpermission/teampermissions.go @@ -119,6 +119,18 @@ func (t TeamPermissions) GetByValues(values ...string) TeamPermissions { }) } +func (t TeamPermissions) ToMaps() []util.ValueMap { + return lo.Map(t, func(x *TeamPermission, _ int) util.ValueMap { + return x.ToMap() + }) +} + +func (t TeamPermissions) ToOrderedMaps() util.OrderedMaps[any] { + return lo.Map(t, func(x *TeamPermission, _ int) *util.OrderedMap[any] { + return x.ToOrderedMap() + }) +} + func (t TeamPermissions) ToCSV() ([]string, [][]string) { return TeamPermissionFieldDescs.Keys(), lo.Map(t, func(x *TeamPermission, _ int) []string { return x.Strings() diff --git a/app/user/usermap.go b/app/user/usermap.go index d62a647a..a4f21765 100644 --- a/app/user/usermap.go +++ b/app/user/usermap.go @@ -37,3 +37,9 @@ func UserFromMap(m util.ValueMap, setPK bool) (*User, util.ValueMap, error) { // $PF_SECTION_END(extrachecks)$ return ret, extra, nil } + +//nolint:lll +func (u *User) ToOrderedMap() *util.OrderedMap[any] { + pairs := util.OrderedPairs[any]{{K: "id", V: u.ID}, {K: "name", V: u.Name}, {K: "picture", V: u.Picture}, {K: "created", V: u.Created}, {K: "updated", V: u.Updated}} + return util.NewOrderedMap[any](false, 4, pairs...) +} diff --git a/app/user/users.go b/app/user/users.go index b536b362..684ef5d5 100644 --- a/app/user/users.go +++ b/app/user/users.go @@ -55,6 +55,18 @@ func (u Users) GetByIDs(ids ...uuid.UUID) Users { }) } +func (u Users) ToMaps() []util.ValueMap { + return lo.Map(u, func(x *User, _ int) util.ValueMap { + return x.ToMap() + }) +} + +func (u Users) ToOrderedMaps() util.OrderedMaps[any] { + return lo.Map(u, func(x *User, _ int) *util.OrderedMap[any] { + return x.ToOrderedMap() + }) +} + func (u Users) ToCSV() ([]string, [][]string) { return UserFieldDescs.Keys(), lo.Map(u, func(x *User, _ int) []string { return x.Strings() diff --git a/app/util/debug.go b/app/util/debug.go index 7cf24deb..dd958b1b 100644 --- a/app/util/debug.go +++ b/app/util/debug.go @@ -27,33 +27,33 @@ func DebugGetInfo(version string, started time.Time) *DebugInfo { serverTags := NewOrderedMap[string](false, 10) hostname, _ := os.Hostname() - serverTags.Append("Machine Name", hostname) - serverTags.Append("CPU Architecture", runtime.GOARCH) - serverTags.Append("Operating System", runtime.GOOS) - serverTags.Append("CPU Count", fmt.Sprint(runtime.NumCPU())) + serverTags.Set("Machine Name", hostname) + serverTags.Set("CPU Architecture", runtime.GOARCH) + serverTags.Set("Operating System", runtime.GOOS) + serverTags.Set("CPU Count", fmt.Sprint(runtime.NumCPU())) appTags := NewOrderedMap[string](false, 10) - appTags.Append("Name", AppName) + appTags.Set("Name", AppName) exec, _ := os.Executable() wind, exec := StringSplitLast(exec, '/', true) if exec == "" { _, exec = StringSplitLast(wind, '\\', true) } - appTags.Append("Executable", exec) - appTags.Append("Version", version) - appTags.Append("Go Version", runtime.Version()) - appTags.Append("Compiler", runtime.Compiler) + appTags.Set("Executable", exec) + appTags.Set("Version", version) + appTags.Set("Go Version", runtime.Version()) + appTags.Set("Compiler", runtime.Compiler) runtimeTags := NewOrderedMap[string](false, 10) args := os.Args if len(args) > 0 { args = args[1:] } - runtimeTags.Append("Running Since", TimeRelative(&started)) - runtimeTags.Append("Arguments", strings.Join(args, " ")) - runtimeTags.Append("Max Processes", fmt.Sprint(runtime.GOMAXPROCS(-1))) - runtimeTags.Append("Go Routines", fmt.Sprint(runtime.NumGoroutine())) - runtimeTags.Append("Cgo Calls", fmt.Sprint(runtime.NumCgoCall())) + runtimeTags.Set("Running Since", TimeRelative(&started)) + runtimeTags.Set("Arguments", strings.Join(args, " ")) + runtimeTags.Set("Max Processes", fmt.Sprint(runtime.GOMAXPROCS(-1))) + runtimeTags.Set("Go Routines", fmt.Sprint(runtime.NumGoroutine())) + runtimeTags.Set("Cgo Calls", fmt.Sprint(runtime.NumCgoCall())) return &DebugInfo{ServerTags: serverTags, AppTags: appTags, RuntimeTags: runtimeTags, Mods: bi.Deps} } diff --git a/app/util/map.go b/app/util/map.go index 8d4aa3c7..451b6939 100644 --- a/app/util/map.go +++ b/app/util/map.go @@ -189,3 +189,11 @@ func ValueMapGet[T any](m ValueMap, pth string) (T, error) { } return ret, nil } + +type ToMap interface { + ToMap() ValueMap +} + +type ToMaps interface { + ToMaps() []ValueMap +} diff --git a/app/util/mapordered.go b/app/util/mapordered.go index c84a48fb..470db5b8 100644 --- a/app/util/mapordered.go +++ b/app/util/mapordered.go @@ -16,28 +16,30 @@ type OrderedPair[V any] struct { V V `json:"v"` } +func NewOrderedPair[V any](k string, v V) *OrderedPair[V] { + return &OrderedPair[V]{K: k, V: v} +} + +type OrderedPairs[V any] []*OrderedPair[V] + type OrderedMap[V any] struct { Lexical bool Order []string Map map[string]V } -func NewOrderedMap[V any](lexical bool, capacity int) *OrderedMap[V] { - return &OrderedMap[V]{Lexical: lexical, Order: make([]string, 0, capacity), Map: make(map[string]V, capacity)} +func NewOrderedMap[V any](lexical bool, capacity int, pairs ...*OrderedPair[V]) *OrderedMap[V] { + ret := &OrderedMap[V]{Lexical: lexical, Order: make([]string, 0, capacity), Map: make(map[string]V, capacity)} + for _, p := range pairs { + ret.Set(p.K, p.V) + } + return ret } func NewOMap[V any]() *OrderedMap[V] { return NewOrderedMap[V](false, 0) } -func (o *OrderedMap[V]) Append(k string, v V) { - o.Order = append(o.Order, k) - o.Map[k] = v - if o.Lexical { - slices.Sort(o.Order) - } -} - func (o *OrderedMap[V]) Set(k string, v V) { if _, ok := o.Map[k]; !ok { o.Order = append(o.Order, k) @@ -68,7 +70,7 @@ func (o *OrderedMap[V]) GetSimple(k string) V { func (o *OrderedMap[V]) Pairs() []*OrderedPair[V] { return lo.Map(o.Order, func(k string, _ int) *OrderedPair[V] { - return &OrderedPair[V]{K: k, V: o.GetSimple(k)} + return NewOrderedPair(k, o.GetSimple(k)) }) } @@ -155,3 +157,13 @@ func (o OrderedMap[V]) MarshalJSON() ([]byte, error) { buf.WriteByte('}') return buf.Bytes(), nil } + +type OrderedMaps[V any] []*OrderedMap[V] + +type ToOrderedMap[T any] interface { + ToOrderedMap() *OrderedMap[T] +} + +type ToOrderedMaps[T any] interface { + ToOrderedMaps() OrderedMaps[T] +} diff --git a/app/util/mapordered_test.go b/app/util/mapordered_test.go index 2f2c908e..9d93c548 100644 --- a/app/util/mapordered_test.go +++ b/app/util/mapordered_test.go @@ -39,20 +39,6 @@ func TestNewOMap(t *testing.T) { } } -func TestOrderedMap_Append(t *testing.T) { - t.Parallel() - om := util.NewOMap[int]() - om.Append("a", 1) - om.Append("b", 2) - - if len(om.Order) != 2 || om.Order[0] != "a" || om.Order[1] != "b" { - t.Errorf("unexpected Order: %v", om.Order) - } - if om.Map["a"] != 1 || om.Map["b"] != 2 { - t.Errorf("unexpected Map: %v", om.Map) - } -} - func TestOrderedMap_Set(t *testing.T) { t.Parallel() om := util.NewOMap[int]() @@ -84,8 +70,8 @@ func TestOrderedMap_HasKey(t *testing.T) { func TestOrderedMap_IndexOf(t *testing.T) { t.Parallel() om := util.NewOMap[int]() - om.Append("a", 1) - om.Append("b", 2) + om.Set("a", 1) + om.Set("b", 2) if om.IndexOf("a") != 0 { t.Errorf("expected IndexOf('a') to be 0, got %d", om.IndexOf("a")) @@ -124,8 +110,8 @@ func TestOrderedMap_GetSimple(t *testing.T) { func TestOrderedMap_Pairs(t *testing.T) { t.Parallel() om := util.NewOMap[int]() - om.Append("a", 1) - om.Append("b", 2) + om.Set("a", 1) + om.Set("b", 2) pairs := om.Pairs() expected := []*util.OrderedPair[int]{ @@ -141,8 +127,8 @@ func TestOrderedMap_Pairs(t *testing.T) { func TestOrderedMap_Remove(t *testing.T) { t.Parallel() om := util.NewOMap[int]() - om.Append("a", 1) - om.Append("b", 2) + om.Set("a", 1) + om.Set("b", 2) om.Remove("a") if len(om.Order) != 1 || om.Order[0] != "b" { @@ -156,8 +142,8 @@ func TestOrderedMap_Remove(t *testing.T) { func TestOrderedMap_MarshalJSON(t *testing.T) { t.Parallel() om := util.NewOMap[int]() - om.Append("b", 2) - om.Append("a", 1) + om.Set("b", 2) + om.Set("a", 1) b, err := json.Marshal(om) if err != nil { @@ -189,8 +175,8 @@ func TestOrderedMap_UnmarshalJSON(t *testing.T) { func TestOrderedMap_MarshalXML(t *testing.T) { t.Parallel() om := util.NewOMap[int]() - om.Append("b", 2) - om.Append("a", 1) + om.Set("b", 2) + om.Set("a", 1) b, err := xml.Marshal(om) if err != nil { diff --git a/go.mod b/go.mod index 6a069ece..929a1325 100644 --- a/go.mod +++ b/go.mod @@ -1,6 +1,8 @@ module github.com/kyleu/rituals -go 1.22 +go 1.22.7 + +toolchain go1.22.9 require ( github.com/CAFxX/httpcompression v0.0.9 @@ -11,7 +13,7 @@ require ( github.com/dsoprea/go-exif/v3 v3.0.1 github.com/dustin/go-humanize v1.0.1 github.com/gertd/go-pluralize v0.2.1 - github.com/gomarkdown/markdown v0.0.0-20240730141124-034f12af3bf6 + github.com/gomarkdown/markdown v0.0.0-20241105142532-d03b89096d81 github.com/google/go-github/v39 v39.2.0 github.com/google/uuid v1.6.0 github.com/gorilla/mux v1.8.1 @@ -23,29 +25,29 @@ require ( github.com/markbates/going v1.0.3 github.com/markbates/goth v1.80.0 github.com/microcosm-cc/bluemonday v1.0.26 - github.com/mileusna/useragent v1.3.4 + github.com/mileusna/useragent v1.3.5 github.com/muesli/coral v1.0.0 github.com/pelletier/go-toml v1.9.5 github.com/pkg/errors v0.9.1 - github.com/prometheus/client_golang v1.20.2 + github.com/prometheus/client_golang v1.20.5 github.com/russross/blackfriday v1.6.0 github.com/samber/lo v1.47.0 github.com/spf13/afero v1.11.0 github.com/valyala/quicktemplate v1.8.0 - go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.54.0 - go.opentelemetry.io/otel v1.29.0 - go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracehttp v1.29.0 - go.opentelemetry.io/otel/sdk v1.29.0 - go.opentelemetry.io/otel/trace v1.29.0 + go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.57.0 + go.opentelemetry.io/otel v1.32.0 + go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracehttp v1.32.0 + go.opentelemetry.io/otel/sdk v1.32.0 + go.opentelemetry.io/otel/trace v1.32.0 go.uber.org/zap v1.27.0 - golang.org/x/exp v0.0.0-20240823005443-9b4947da3948 - golang.org/x/oauth2 v0.22.0 + golang.org/x/exp v0.0.0-20241108190413-2d47ceb2692f + golang.org/x/oauth2 v0.24.0 gopkg.in/yaml.v2 v2.4.0 ) require ( - cloud.google.com/go/compute/metadata v0.5.0 // indirect - github.com/andybalholm/brotli v1.1.0 // indirect + cloud.google.com/go/compute/metadata v0.5.2 // indirect + github.com/andybalholm/brotli v1.1.1 // indirect github.com/aymerick/douceur v0.2.0 // indirect github.com/beorn7/perks v1.0.1 // indirect github.com/cenkalti/backoff/v4 v4.3.0 // indirect @@ -59,11 +61,11 @@ require ( github.com/go-logr/logr v1.4.2 // indirect github.com/go-logr/stdr v1.2.2 // indirect github.com/goccy/go-json v0.10.3 // indirect - github.com/golang-jwt/jwt/v4 v4.5.0 // indirect + github.com/golang-jwt/jwt/v4 v4.5.1 // indirect github.com/golang/geo v0.0.0-20230421003525-6adc56603217 // indirect github.com/google/go-querystring v1.1.0 // indirect github.com/gorilla/css v1.0.0 // indirect - github.com/grpc-ecosystem/grpc-gateway/v2 v2.22.0 // indirect + github.com/grpc-ecosystem/grpc-gateway/v2 v2.23.0 // indirect github.com/inconshreveable/mousetrap v1.1.0 // indirect github.com/jackc/chunkreader/v2 v2.0.1 // indirect github.com/jackc/pgconn v1.14.3 // indirect @@ -72,7 +74,7 @@ require ( github.com/jackc/pgproto3/v2 v2.3.3 // indirect github.com/jackc/pgservicefile v0.0.0-20240606120523-5a60cdf6a761 // indirect github.com/jackc/pgtype v1.14.3 // indirect - github.com/klauspost/compress v1.17.9 // indirect + github.com/klauspost/compress v1.17.11 // indirect github.com/lestrrat-go/backoff/v2 v2.0.8 // indirect github.com/lestrrat-go/blackmagic v1.0.2 // indirect github.com/lestrrat-go/httpcc v1.0.1 // indirect @@ -84,20 +86,20 @@ require ( github.com/mrjones/oauth v0.0.0-20190623134757-126b35219450 // indirect github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 // indirect github.com/prometheus/client_model v0.6.1 // indirect - github.com/prometheus/common v0.57.0 // indirect + github.com/prometheus/common v0.60.1 // indirect github.com/prometheus/procfs v0.15.1 // indirect github.com/spf13/pflag v1.0.5 // indirect github.com/valyala/bytebufferpool v1.0.0 // indirect - go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.29.0 // indirect - go.opentelemetry.io/otel/metric v1.29.0 // indirect + go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.32.0 // indirect + go.opentelemetry.io/otel/metric v1.32.0 // indirect go.opentelemetry.io/proto/otlp v1.3.1 // indirect go.uber.org/multierr v1.11.0 // indirect - golang.org/x/crypto v0.26.0 // indirect - golang.org/x/net v0.28.0 // indirect - golang.org/x/sys v0.24.0 // indirect - golang.org/x/text v0.17.0 // indirect - google.golang.org/genproto/googleapis/api v0.0.0-20240827150818-7e3bb234dfed // indirect - google.golang.org/genproto/googleapis/rpc v0.0.0-20240827150818-7e3bb234dfed // indirect - google.golang.org/grpc v1.66.0 // indirect - google.golang.org/protobuf v1.34.2 // indirect + golang.org/x/crypto v0.29.0 // indirect + golang.org/x/net v0.31.0 // indirect + golang.org/x/sys v0.27.0 // indirect + golang.org/x/text v0.20.0 // indirect + google.golang.org/genproto/googleapis/api v0.0.0-20241118233622-e639e219e697 // indirect + google.golang.org/genproto/googleapis/rpc v0.0.0-20241118233622-e639e219e697 // indirect + google.golang.org/grpc v1.68.0 // indirect + google.golang.org/protobuf v1.35.2 // indirect ) diff --git a/go.sum b/go.sum index 5963a1c6..8ee403fb 100644 --- a/go.sum +++ b/go.sum @@ -1,5 +1,5 @@ -cloud.google.com/go/compute/metadata v0.5.0 h1:Zr0eK8JbFv6+Wi4ilXAR8FJ3wyNdpxHKJNPos6LTZOY= -cloud.google.com/go/compute/metadata v0.5.0/go.mod h1:aHnloV2TPI38yx4s9+wAZhHykWvVCfu7hQbF+9CWoiY= +cloud.google.com/go/compute/metadata v0.5.2 h1:UxK4uu/Tn+I3p2dYWTfiX4wva7aYlKixAHn3fyqngqo= +cloud.google.com/go/compute/metadata v0.5.2/go.mod h1:C66sj2AluDcIqakBq/M8lw8/ybHgOZqin2obFxa/E5k= filippo.io/edwards25519 v1.1.0 h1:FNf4tywRC1HmFuKW5xopWpigGjJKiJSV0Cqo0cJWDaA= filippo.io/edwards25519 v1.1.0/go.mod h1:BxyFTGdWcka3PhytdK4V28tE5sGfRvvvRV7EaN4VDT4= github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU= @@ -10,8 +10,8 @@ github.com/Masterminds/semver/v3 v3.1.1/go.mod h1:VPu/7SZ7ePZ3QOrcuXROw5FAcLl4a0 github.com/alecthomas/chroma v0.10.0 h1:7XDcGkCQopCNKjZHfYrNLraA+M7e0fMiJ/Mfikbfjek= github.com/alecthomas/chroma v0.10.0/go.mod h1:jtJATyUxlIORhUOFNA9NZDWGAQ8wpxQQqNSB4rjA/1s= github.com/andybalholm/brotli v1.0.5/go.mod h1:fO7iG3H7G2nSZ7m0zPUDn85XEX2GTukHGRSepvi9Eig= -github.com/andybalholm/brotli v1.1.0 h1:eLKJA0d02Lf0mVpIDgYnqXcUn0GqVmEFny3VuID1U3M= -github.com/andybalholm/brotli v1.1.0/go.mod h1:sms7XGricyQI9K10gOSf56VKKWS4oLer58Q+mhRPtnY= +github.com/andybalholm/brotli v1.1.1 h1:PR2pgnyFznKEugtsUo0xLdDop5SKXd5Qf5ysW+7XdTA= +github.com/andybalholm/brotli v1.1.1/go.mod h1:05ib4cKhjx3OQYUY22hTVd34Bc8upXjOLL2rKwwZBoA= github.com/araddon/dateparse v0.0.0-20210429162001-6b43995a97de h1:FxWPpzIjnTlhPwqqXc4/vE0f7GvRjuAsbW+HOIe8KnA= github.com/araddon/dateparse v0.0.0-20210429162001-6b43995a97de/go.mod h1:DCaWoUhZrYW9p1lxo/cm8EmUOOzAPSEZNGF2DK1dJgw= github.com/aymerick/douceur v0.2.0 h1:Mv+mAeH1Q+n9Fr+oyamOlAkUNPWPlA8PPGR0QAaYuPk= @@ -84,8 +84,8 @@ github.com/goccy/go-json v0.10.3 h1:KZ5WoDbxAIgm2HNbYckL0se1fHD6rz5j4ywS6ebzDqA= github.com/goccy/go-json v0.10.3/go.mod h1:oq7eo15ShAhp70Anwd5lgX2pLfOS3QCiwU/PULtXL6M= github.com/gofrs/uuid v4.0.0+incompatible h1:1SD/1F5pU8p29ybwgQSwpQk+mwdRrXCYuPhW6m+TnJw= github.com/gofrs/uuid v4.0.0+incompatible/go.mod h1:b2aQJv3Z4Fp6yNu3cdSllBxTCLRxnplIgP/c0N/04lM= -github.com/golang-jwt/jwt/v4 v4.5.0 h1:7cYmW1XlMY7h7ii7UhUyChSgS5wUJEnm9uZVTGqOWzg= -github.com/golang-jwt/jwt/v4 v4.5.0/go.mod h1:m21LjoU+eqJr34lmDMbreY2eSTRJ1cv77w39/MY0Ch0= +github.com/golang-jwt/jwt/v4 v4.5.1 h1:JdqV9zKUdtaa9gdPlywC3aeoEsR681PlKC+4F5gQgeo= +github.com/golang-jwt/jwt/v4 v4.5.1/go.mod h1:m21LjoU+eqJr34lmDMbreY2eSTRJ1cv77w39/MY0Ch0= github.com/golang/geo v0.0.0-20190916061304-5b978397cfec/go.mod h1:QZ0nwyI2jOfgRAoBvP+ab5aRr7c9x7lhGEJrKvBwjWI= github.com/golang/geo v0.0.0-20200319012246-673a6f80352d/go.mod h1:QZ0nwyI2jOfgRAoBvP+ab5aRr7c9x7lhGEJrKvBwjWI= github.com/golang/geo v0.0.0-20210211234256-740aa86cb551/go.mod h1:QZ0nwyI2jOfgRAoBvP+ab5aRr7c9x7lhGEJrKvBwjWI= @@ -94,8 +94,10 @@ github.com/golang/geo v0.0.0-20230421003525-6adc56603217/go.mod h1:8wI0hitZ3a1Ix github.com/golang/protobuf v1.2.0/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= github.com/golang/protobuf v1.3.1/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= github.com/golang/protobuf v1.3.2/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= -github.com/gomarkdown/markdown v0.0.0-20240730141124-034f12af3bf6 h1:ZPy+2XJ8u0bB3sNFi+I72gMEMS7MTg7aZCCXPOjV8iw= -github.com/gomarkdown/markdown v0.0.0-20240730141124-034f12af3bf6/go.mod h1:JDGcbDT52eL4fju3sZ4TeHGsQwhG9nbDV21aMyhwPoA= +github.com/golang/protobuf v1.5.4 h1:i7eJL8qZTpSEXOPTxNKhASYpMn+8e5Q6AdndVa1dWek= +github.com/golang/protobuf v1.5.4/go.mod h1:lnTiLA8Wa4RWRcIUkrtSVa5nRhsEGBg48fD6rSs7xps= +github.com/gomarkdown/markdown v0.0.0-20241105142532-d03b89096d81 h1:5lyLWsV+qCkoYqsKUDuycESh9DEIPVKN6iCFeL7ag50= +github.com/gomarkdown/markdown v0.0.0-20241105142532-d03b89096d81/go.mod h1:JDGcbDT52eL4fju3sZ4TeHGsQwhG9nbDV21aMyhwPoA= github.com/google/brotli/go/cbrotli v0.0.0-20230829110029-ed738e842d2f h1:jopqB+UTSdJGEJT8tEqYyE29zN91fi2827oLET8tl7k= github.com/google/brotli/go/cbrotli v0.0.0-20230829110029-ed738e842d2f/go.mod h1:nOPhAkwVliJdNTkj3gXpljmWhjc4wCaVqbMJcPKWP4s= github.com/google/go-cmp v0.5.2/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= @@ -120,8 +122,8 @@ github.com/gorilla/pat v0.0.0-20180118222023-199c85a7f6d1 h1:LqbZZ9sNMWVjeXS4NN5 github.com/gorilla/pat v0.0.0-20180118222023-199c85a7f6d1/go.mod h1:YeAe0gNeiNT5hoiZRI4yiOky6jVdNvfO2N6Kav/HmxY= github.com/gorilla/websocket v1.5.3 h1:saDtZ6Pbx/0u+bgYQ3q96pZgCzfhKXGPqt7kZ72aNNg= github.com/gorilla/websocket v1.5.3/go.mod h1:YR8l580nyteQvAITg2hZ9XVh4b55+EU/adAjf1fMHhE= -github.com/grpc-ecosystem/grpc-gateway/v2 v2.22.0 h1:asbCHRVmodnJTuQ3qamDwqVOIjwqUPTYmYuemVOx+Ys= -github.com/grpc-ecosystem/grpc-gateway/v2 v2.22.0/go.mod h1:ggCgvZ2r7uOoQjOyu2Y1NhHmEPPzzuhWgcza5M1Ji1I= +github.com/grpc-ecosystem/grpc-gateway/v2 v2.23.0 h1:ad0vkEBuk23VJzZR9nkLVG0YAoN9coASF1GusYX6AlU= +github.com/grpc-ecosystem/grpc-gateway/v2 v2.23.0/go.mod h1:igFoXX2ELCW06bol23DWPB5BEWfZISOzSP5K2sbLea0= github.com/hpcloud/tail v1.0.0/go.mod h1:ab1qPbhIpdTxEkNHXyeSf5vhxWSCs/tWer42PpOxQnU= github.com/inconshreveable/mousetrap v1.0.0/go.mod h1:PxqpIevigyE2G7u3NXJIT2ANytuPF1OarO4DADm73n8= github.com/inconshreveable/mousetrap v1.1.0 h1:wN+x4NVGpMsO7ErUn/mUI3vEoE6Jt13X2s0bqwp9tc8= @@ -189,8 +191,8 @@ github.com/kirsle/configdir v0.0.0-20170128060238-e45d2f54772f h1:dKccXx7xA56UNq github.com/kirsle/configdir v0.0.0-20170128060238-e45d2f54772f/go.mod h1:4rEELDSfUAlBSyUjPG0JnaNGjf13JySHFeRdD/3dLP0= github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+oQHNcck= github.com/klauspost/compress v1.16.7/go.mod h1:ntbaceVETuRiXiv4DpjP66DpAtAGkEQskQzEyD//IeE= -github.com/klauspost/compress v1.17.9 h1:6KIumPrER1LHsvBVuDa0r5xaG0Es51mhhB9BQB2qeMA= -github.com/klauspost/compress v1.17.9/go.mod h1:Di0epgTjJY877eYKx5yC51cX2A2Vl2ibi7bDH9ttBbw= +github.com/klauspost/compress v1.17.11 h1:In6xLpyWOi1+C7tXUUWv2ot1QvBjxevKAaI6IXrJmUc= +github.com/klauspost/compress v1.17.11/go.mod h1:pMDklpSncoRMuLFrf1W9Ss9KT+0rH90U12bZKk7uwG0= github.com/klauspost/pgzip v1.2.6/go.mod h1:Ch1tH69qFZu15pkjo5kYi6mth2Zzwzt50oCQKQE9RUs= github.com/konsorten/go-windows-terminal-sequences v1.0.1/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ= github.com/konsorten/go-windows-terminal-sequences v1.0.2/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ= @@ -237,8 +239,8 @@ github.com/mattn/go-sqlite3 v1.14.22 h1:2gZY6PC6kBnID23Tichd1K+Z0oS6nE/XwU+Vz/5o github.com/mattn/go-sqlite3 v1.14.22/go.mod h1:Uh1q+B4BYcTPb+yiD3kU8Ct7aC0hY9fxUwlHK0RXw+Y= github.com/microcosm-cc/bluemonday v1.0.26 h1:xbqSvqzQMeEHCqMi64VAs4d8uy6Mequs3rQ0k/Khz58= github.com/microcosm-cc/bluemonday v1.0.26/go.mod h1:JyzOCs9gkyQyjs+6h10UEVSe02CGwkhd72Xdqh78TWs= -github.com/mileusna/useragent v1.3.4 h1:MiuRRuvGjEie1+yZHO88UBYg8YBC/ddF6T7F56i3PCk= -github.com/mileusna/useragent v1.3.4/go.mod h1:3d8TOmwL/5I8pJjyVDteHtgDGcefrFUX4ccGOMKNYYc= +github.com/mileusna/useragent v1.3.5 h1:SJM5NzBmh/hO+4LGeATKpaEX9+b4vcGg2qXGLiNGDws= +github.com/mileusna/useragent v1.3.5/go.mod h1:3d8TOmwL/5I8pJjyVDteHtgDGcefrFUX4ccGOMKNYYc= github.com/modern-go/concurrent v0.0.0-20180228061459-e0a39a4cb421/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q= github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd h1:TRLaZ9cD/w8PVh93nsPXa1VrQ6jlwL5oN8l14QlcNfg= github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q= @@ -262,18 +264,18 @@ github.com/pkg/errors v0.9.1 h1:FEBLx1zS214owpjy7qsBeixbURkuhQAwrK5UwLGTwt4= github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= -github.com/prometheus/client_golang v1.20.2 h1:5ctymQzZlyOON1666svgwn3s6IKWgfbjsejTMiXIyjg= -github.com/prometheus/client_golang v1.20.2/go.mod h1:PIEt8X02hGcP8JWbeHyeZ53Y/jReSnHgO035n//V5WE= +github.com/prometheus/client_golang v1.20.5 h1:cxppBPuYhUnsO6yo/aoRol4L7q7UFfdm+bR9r+8l63Y= +github.com/prometheus/client_golang v1.20.5/go.mod h1:PIEt8X02hGcP8JWbeHyeZ53Y/jReSnHgO035n//V5WE= github.com/prometheus/client_model v0.6.1 h1:ZKSh/rekM+n3CeS952MLRAdFwIKqeY8b62p8ais2e9E= github.com/prometheus/client_model v0.6.1/go.mod h1:OrxVMOVHjw3lKMa8+x6HeMGkHMQyHDk9E3jmP2AmGiY= -github.com/prometheus/common v0.57.0 h1:Ro/rKjwdq9mZn1K5QPctzh+MA4Lp0BuYk5ZZEVhoNcY= -github.com/prometheus/common v0.57.0/go.mod h1:7uRPFSUTbfZWsJ7MHY56sqt7hLQu3bxXHDnNhl8E9qI= +github.com/prometheus/common v0.60.1 h1:FUas6GcOw66yB/73KC+BOZoFJmbo/1pojoILArPAaSc= +github.com/prometheus/common v0.60.1/go.mod h1:h0LYf1R1deLSKtD4Vdg8gy4RuOvENW2J/h19V5NADQw= github.com/prometheus/procfs v0.15.1 h1:YagwOFzUgYfKKHX6Dr+sHT7km/hxC76UB0learggepc= github.com/prometheus/procfs v0.15.1/go.mod h1:fB45yRUv8NstnjriLhBQLuOUt+WW4BsoGhij/e3PBqk= github.com/rivo/uniseg v0.1.0/go.mod h1:J6wj4VEh+S6ZtnVlnTBMWIodfgj8LQOQFoIToxlJtxc= github.com/rogpeppe/go-internal v1.3.0/go.mod h1:M8bDsm7K2OlrFYOpmOWEs/qY81heoFRclV5y23lUDJ4= -github.com/rogpeppe/go-internal v1.12.0 h1:exVL4IDcn6na9z1rAb56Vxr+CgyK3nn3O+epU5NdKM8= -github.com/rogpeppe/go-internal v1.12.0/go.mod h1:E+RYuTGaKKdloAfM02xzb0FW3Paa99yedzYV+kq4uf4= +github.com/rogpeppe/go-internal v1.13.1 h1:KvO1DLK/DRN07sQ1LQKScxyZJuNnedQ5/wKSR38lUII= +github.com/rogpeppe/go-internal v1.13.1/go.mod h1:uMEvuHeurkdAXX61udpOXGD/AzZDWNMNyH2VO9fmH0o= github.com/rs/xid v1.2.1/go.mod h1:+uKXf+4Djp6Md1KODXJxgGQPKngRmWyn10oCKFzNHOQ= github.com/rs/zerolog v1.13.0/go.mod h1:YbFCdg8HfsridGWAh22vktObvhZbQsZXe4/zB0OKkWU= github.com/rs/zerolog v1.15.0/go.mod h1:xYTKnLHcpfU2225ny5qZjxnj9NvkumZYjJHlAThCjNc= @@ -318,22 +320,24 @@ github.com/valyala/gozstd v1.20.1 h1:xPnnnvjmaDDitMFfDxmQ4vpx0+3CdTg2o3lALvXTU/g github.com/valyala/gozstd v1.20.1/go.mod h1:y5Ew47GLlP37EkTB+B4s7r6A5rdaeB7ftbl9zoYiIPQ= github.com/valyala/quicktemplate v1.8.0 h1:zU0tjbIqTRgKQzFY1L42zq0qR3eh4WoQQdIdqCysW5k= github.com/valyala/quicktemplate v1.8.0/go.mod h1:qIqW8/igXt8fdrUln5kOSb+KWMaJ4Y8QUsfd1k6L2jM= +github.com/xyproto/randomstring v1.0.5 h1:YtlWPoRdgMu3NZtP45drfy1GKoojuR7hmRcnhZqKjWU= +github.com/xyproto/randomstring v1.0.5/go.mod h1:rgmS5DeNXLivK7YprL0pY+lTuhNQW3iGxZ18UQApw/E= github.com/yuin/goldmark v1.4.13/go.mod h1:6yULJ656Px+3vBD8DxQVa3kxgyrAnzto9xy5taEt/CY= github.com/zenazn/goji v0.9.0/go.mod h1:7S9M489iMyHBNxwZnk9/EHS098H4/F6TATF2mIxtB1Q= -go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.54.0 h1:TT4fX+nBOA/+LUkobKGW1ydGcn+G3vRw9+g5HwCphpk= -go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.54.0/go.mod h1:L7UH0GbB0p47T4Rri3uHjbpCFYrVrwc1I25QhNPiGK8= -go.opentelemetry.io/otel v1.29.0 h1:PdomN/Al4q/lN6iBJEN3AwPvUiHPMlt93c8bqTG5Llw= -go.opentelemetry.io/otel v1.29.0/go.mod h1:N/WtXPs1CNCUEx+Agz5uouwCba+i+bJGFicT8SR4NP8= -go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.29.0 h1:dIIDULZJpgdiHz5tXrTgKIMLkus6jEFa7x5SOKcyR7E= -go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.29.0/go.mod h1:jlRVBe7+Z1wyxFSUs48L6OBQZ5JwH2Hg/Vbl+t9rAgI= -go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracehttp v1.29.0 h1:JAv0Jwtl01UFiyWZEMiJZBiTlv5A50zNs8lsthXqIio= -go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracehttp v1.29.0/go.mod h1:QNKLmUEAq2QUbPQUfvw4fmv0bgbK7UlOSFCnXyfvSNc= -go.opentelemetry.io/otel/metric v1.29.0 h1:vPf/HFWTNkPu1aYeIsc98l4ktOQaL6LeSoeV2g+8YLc= -go.opentelemetry.io/otel/metric v1.29.0/go.mod h1:auu/QWieFVWx+DmQOUMgj0F8LHWdgalxXqvp7BII/W8= -go.opentelemetry.io/otel/sdk v1.29.0 h1:vkqKjk7gwhS8VaWb0POZKmIEDimRCMsopNYnriHyryo= -go.opentelemetry.io/otel/sdk v1.29.0/go.mod h1:pM8Dx5WKnvxLCb+8lG1PRNIDxu9g9b9g59Qr7hfAAok= -go.opentelemetry.io/otel/trace v1.29.0 h1:J/8ZNK4XgR7a21DZUAsbF8pZ5Jcw1VhACmnYt39JTi4= -go.opentelemetry.io/otel/trace v1.29.0/go.mod h1:eHl3w0sp3paPkYstJOmAimxhiFXPg+MMTlEh3nsQgWQ= +go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.57.0 h1:DheMAlT6POBP+gh8RUH19EOTnQIor5QE0uSRPtzCpSw= +go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.57.0/go.mod h1:wZcGmeVO9nzP67aYSLDqXNWK87EZWhi7JWj1v7ZXf94= +go.opentelemetry.io/otel v1.32.0 h1:WnBN+Xjcteh0zdk01SVqV55d/m62NJLJdIyb4y/WO5U= +go.opentelemetry.io/otel v1.32.0/go.mod h1:00DCVSB0RQcnzlwyTfqtxSm+DRr9hpYrHjNGiBHVQIg= +go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.32.0 h1:IJFEoHiytixx8cMiVAO+GmHR6Frwu+u5Ur8njpFO6Ac= +go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.32.0/go.mod h1:3rHrKNtLIoS0oZwkY2vxi+oJcwFRWdtUyRII+so45p8= +go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracehttp v1.32.0 h1:cMyu9O88joYEaI47CnQkxO1XZdpoTF9fEnW2duIddhw= +go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracehttp v1.32.0/go.mod h1:6Am3rn7P9TVVeXYG+wtcGE7IE1tsQ+bP3AuWcKt/gOI= +go.opentelemetry.io/otel/metric v1.32.0 h1:xV2umtmNcThh2/a/aCP+h64Xx5wsj8qqnkYZktzNa0M= +go.opentelemetry.io/otel/metric v1.32.0/go.mod h1:jH7CIbbK6SH2V2wE16W05BHCtIDzauciCRLoc/SyMv8= +go.opentelemetry.io/otel/sdk v1.32.0 h1:RNxepc9vK59A8XsgZQouW8ue8Gkb4jpWtJm9ge5lEG4= +go.opentelemetry.io/otel/sdk v1.32.0/go.mod h1:LqgegDBjKMmb2GC6/PrTnteJG39I8/vJCAP9LlJXEjU= +go.opentelemetry.io/otel/trace v1.32.0 h1:WIC9mYrXf8TmY/EXuULKc8hR17vE+Hjv2cssQDe03fM= +go.opentelemetry.io/otel/trace v1.32.0/go.mod h1:+i4rkvCraA+tG6AzwloGaCtkx53Fa+L+V8e9a7YvhT8= go.opentelemetry.io/proto/otlp v1.3.1 h1:TrMUixzpM0yuc/znrFTP9MMRh8trP93mkCiDVeXrui0= go.opentelemetry.io/proto/otlp v1.3.1/go.mod h1:0X1WI4de4ZsLrrJNLAQbFeLCm3T7yBkR0XqQ7niQU+8= go.uber.org/atomic v1.3.2/go.mod h1:gD2HeocX3+yG+ygLZcrzQJaqmWj9AIm7n08wl/qW/PE= @@ -366,10 +370,10 @@ golang.org/x/crypto v0.0.0-20210817164053-32db794688a5/go.mod h1:GvvjBRRGRdwPK5y golang.org/x/crypto v0.0.0-20210921155107-089bfa567519/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= golang.org/x/crypto v0.19.0/go.mod h1:Iy9bg/ha4yyC70EfRS8jz+B6ybOBKMaSxLj6P6oBDfU= golang.org/x/crypto v0.20.0/go.mod h1:Xwo95rrVNIoSMx9wa1JroENMToLWn3RNVrTBpLHgZPQ= -golang.org/x/crypto v0.26.0 h1:RrRspgV4mU+YwB4FYnuBoKsUapNIL5cohGAmSH3azsw= -golang.org/x/crypto v0.26.0/go.mod h1:GY7jblb9wI+FOo5y8/S2oY4zWP07AkOJ4+jxCqdqn54= -golang.org/x/exp v0.0.0-20240823005443-9b4947da3948 h1:kx6Ds3MlpiUHKj7syVnbp57++8WpuKPcR5yjLBjvLEA= -golang.org/x/exp v0.0.0-20240823005443-9b4947da3948/go.mod h1:akd2r19cwCdwSwWeIdzYQGa/EZZyqcOdwWiwj5L5eKQ= +golang.org/x/crypto v0.29.0 h1:L5SG1JTTXupVV3n6sUqMTeWbjAyfPwoda2DLX8J8FrQ= +golang.org/x/crypto v0.29.0/go.mod h1:+F4F4N5hv6v38hfeYwTdx20oUvLLc+QfrE9Ax9HtgRg= +golang.org/x/exp v0.0.0-20241108190413-2d47ceb2692f h1:XdNn9LlyWAhLVp6P/i8QYBW+hlyhrhei9uErw2B5GJo= +golang.org/x/exp v0.0.0-20241108190413-2d47ceb2692f/go.mod h1:D5SMRVC3C2/4+F/DB1wZsLRnSNimn2Sp/NPsCrsv8ak= golang.org/x/lint v0.0.0-20190930215403-16217165b5de/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= golang.org/x/mod v0.0.0-20190513183733-4bf6d317e70e/go.mod h1:mXi4GBBbnImb6dmsKGUJ2LatrhH/nqhxcFungHvyanc= golang.org/x/mod v0.1.1-0.20191105210325-c90efee705ee/go.mod h1:QqPTAvyqsEbceGzBzNggFXnrqF1CaUcvgkdR5Ot7KZg= @@ -391,11 +395,11 @@ golang.org/x/net v0.0.0-20221002022538-bcab6841153b/go.mod h1:YDH+HFinaLZZlnHAfS golang.org/x/net v0.6.0/go.mod h1:2Tu9+aMcznHK/AK1HMvgo6xiTLG5rD5rZLDS+rp2Bjs= golang.org/x/net v0.10.0/go.mod h1:0qNGK6F8kojg2nk9dLZ2mShWaEBan6FAoqfSigmmuDg= golang.org/x/net v0.21.0/go.mod h1:bIjVDfnllIU7BJ2DNgfnXvpSvtn8VRwhlsaeUTyUS44= -golang.org/x/net v0.28.0 h1:a9JDOJc5GMUJ0+UDqmLT86WiEy7iWyIhz8gz8E4e5hE= -golang.org/x/net v0.28.0/go.mod h1:yqtgsTWOOnlGLG9GFRrK3++bGOUEkNBoHZc8MEDWPNg= +golang.org/x/net v0.31.0 h1:68CPQngjLL0r2AlUKiSxtQFKvzRVbnzLwMUn5SzcLHo= +golang.org/x/net v0.31.0/go.mod h1:P4fl1q7dY2hnZFxEk4pPSkDHF+QqjitcnDjUQyMM+pM= golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= -golang.org/x/oauth2 v0.22.0 h1:BzDx2FehcG7jJwgWLELCdmLuxk2i+x9UDpSiss2u0ZA= -golang.org/x/oauth2 v0.22.0/go.mod h1:XYTD2NtWslqkgxebSiOHnXEap4TF09sJSc7H1sXbhtI= +golang.org/x/oauth2 v0.24.0 h1:KTBBxWqUa0ykRPLtV69rRto9TLXcqYkeswu48x/gvNE= +golang.org/x/oauth2 v0.24.0/go.mod h1:XYTD2NtWslqkgxebSiOHnXEap4TF09sJSc7H1sXbhtI= golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20220722155255-886fb9371eb4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= @@ -422,8 +426,8 @@ golang.org/x/sys v0.0.0-20220928140112-f11e5e49a4ec/go.mod h1:oPkhp1MJrh7nUepCBc golang.org/x/sys v0.5.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.8.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.17.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= -golang.org/x/sys v0.24.0 h1:Twjiwq9dn6R1fQcyiK+wQyHWfaz/BJB+YIpzU/Cv3Xg= -golang.org/x/sys v0.24.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= +golang.org/x/sys v0.27.0 h1:wBqf8DvsY9Y/2P8gAfPDEYNuS30J4lPHJxXSb/nJZ+s= +golang.org/x/sys v0.27.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= golang.org/x/term v0.0.0-20201117132131-f5c789dd3221/go.mod h1:Nr5EML6q2oocZ2LXRh80K7BxOlk5/8JxuGnuhpl+muw= golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= @@ -439,8 +443,8 @@ golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ= golang.org/x/text v0.7.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8= golang.org/x/text v0.9.0/go.mod h1:e1OnstbJyHTd6l/uOt8jFFHp6TRDWZR/bV3emEE/zU8= golang.org/x/text v0.14.0/go.mod h1:18ZOQIKpY8NJVqYksKHtTdi31H5itFRjB5/qKTNYzSU= -golang.org/x/text v0.17.0 h1:XtiM5bkSOt+ewxlOE/aE/AKEHibwj/6gvWMl9Rsh0Qc= -golang.org/x/text v0.17.0/go.mod h1:BuEKDfySbSR4drPmRPG/7iBdf8hvFMuRexcpahXilzY= +golang.org/x/text v0.20.0 h1:gK/Kv2otX8gz+wn7Rmb3vT96ZwuoxnQlY+HlJVj7Qug= +golang.org/x/text v0.20.0/go.mod h1:D4IsuqiFMhST5bX19pQ9ikHC2GsaKyk/oF+pn3ducp4= golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20190311212946-11955173bddd/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= golang.org/x/tools v0.0.0-20190425163242-31fd60d6bfdc/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q= @@ -459,14 +463,14 @@ golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8T golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= google.golang.org/appengine v1.6.7/go.mod h1:8WjMMxjGQR8xUklV/ARdw2HLXBOI7O7uCIDZVag1xfc= -google.golang.org/genproto/googleapis/api v0.0.0-20240827150818-7e3bb234dfed h1:3RgNmBoI9MZhsj3QxC+AP/qQhNwpCLOvYDYYsFrhFt0= -google.golang.org/genproto/googleapis/api v0.0.0-20240827150818-7e3bb234dfed/go.mod h1:OCdP9MfskevB/rbYvHTsXTtKC+3bHWajPdoKgjcYkfo= -google.golang.org/genproto/googleapis/rpc v0.0.0-20240827150818-7e3bb234dfed h1:J6izYgfBXAI3xTKLgxzTmUltdYaLsuBxFCgDHWJ/eXg= -google.golang.org/genproto/googleapis/rpc v0.0.0-20240827150818-7e3bb234dfed/go.mod h1:UqMtugtsSgubUsoxbuAoiCXvqvErP7Gf0so0mK9tHxU= -google.golang.org/grpc v1.66.0 h1:DibZuoBznOxbDQxRINckZcUvnCEvrW9pcWIE2yF9r1c= -google.golang.org/grpc v1.66.0/go.mod h1:s3/l6xSSCURdVfAnL+TqCNMyTDAGN6+lZeVxnZR128Y= -google.golang.org/protobuf v1.34.2 h1:6xV6lTsCfpGD21XK49h7MhtcApnLqkfYgPcdHftf6hg= -google.golang.org/protobuf v1.34.2/go.mod h1:qYOHts0dSfpeUzUFpOMr/WGzszTmLH+DiWniOlNbLDw= +google.golang.org/genproto/googleapis/api v0.0.0-20241118233622-e639e219e697 h1:pgr/4QbFyktUv9CtQ/Fq4gzEE6/Xs7iCXbktaGzLHbQ= +google.golang.org/genproto/googleapis/api v0.0.0-20241118233622-e639e219e697/go.mod h1:+D9ySVjN8nY8YCVjc5O7PZDIdZporIDY3KaGfJunh88= +google.golang.org/genproto/googleapis/rpc v0.0.0-20241118233622-e639e219e697 h1:LWZqQOEjDyONlF1H6afSWpAL/znlREo2tHfLoe+8LMA= +google.golang.org/genproto/googleapis/rpc v0.0.0-20241118233622-e639e219e697/go.mod h1:5uTbfoYQed2U9p3KIj2/Zzm02PYhndfdmML0qC3q3FU= +google.golang.org/grpc v1.68.0 h1:aHQeeJbo8zAkAa3pRzrVjZlbz6uSfeOXlJNQM0RAbz0= +google.golang.org/grpc v1.68.0/go.mod h1:fmSPC5AsjSBCK54MyHRx48kpOti1/jRfOlwEWywNjWA= +google.golang.org/protobuf v1.35.2 h1:8Ar7bF+apOIoThw1EdZl0p1oWvMqTHmpA2fRTyZO8io= +google.golang.org/protobuf v1.35.2/go.mod h1:9fA7Ob0pmnwhb644+1+CVWFRbNajQ6iRojtC/QF5bRE= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c h1:Hei/4ADfdWqJk1ZMxUNpqntNwaWcugrBjAiHlqqRiVk= diff --git a/views/components/view/Any.html b/views/components/view/Any.html index 687a4dae..7daac1f9 100644 --- a/views/components/view/Any.html +++ b/views/components/view/Any.html @@ -30,10 +30,18 @@ {%= Int(t) %} {% case util.ValueMap %} {%= Map(false, t, ps) %} + {% case util.ToMap %} + {%= Map(false, t.ToMap(), ps) %} {% case map[string]any %} {%= Map(false, t, ps) %} + {% case util.ToOrderedMap[any] %} + {%= OrderedMap(false, t.ToOrderedMap(), ps) %} {% case []util.ValueMap %} {%= MapArray(false, ps, t...) %} + {% case util.ToMaps %} + {%= MapArray(false, ps, t.ToMaps()...) %} + {% case util.ToOrderedMaps[any] %} + {%= OrderedMapArray(false, ps, t.ToOrderedMaps()...) %} {% case util.Pkg %} {%= Package(t) %} {% case string %} diff --git a/views/components/view/Any.html.go b/views/components/view/Any.html.go index 5fd1e192..65d9da80 100644 --- a/views/components/view/Any.html.go +++ b/views/components/view/Any.html.go @@ -72,123 +72,139 @@ func StreamAny(qw422016 *qt422016.Writer, x any, ps *cutil.PageState) { //line views/components/view/Any.html:32 StreamMap(qw422016, false, t, ps) //line views/components/view/Any.html:33 - case map[string]any: + case util.ToMap: //line views/components/view/Any.html:34 - StreamMap(qw422016, false, t, ps) + StreamMap(qw422016, false, t.ToMap(), ps) //line views/components/view/Any.html:35 - case []util.ValueMap: + case map[string]any: //line views/components/view/Any.html:36 - StreamMapArray(qw422016, false, ps, t...) + StreamMap(qw422016, false, t, ps) //line views/components/view/Any.html:37 - case util.Pkg: + case util.ToOrderedMap[any]: //line views/components/view/Any.html:38 - StreamPackage(qw422016, t) + StreamOrderedMap(qw422016, false, t.ToOrderedMap(), ps) //line views/components/view/Any.html:39 - case string: + case []util.ValueMap: //line views/components/view/Any.html:40 - StreamString(qw422016, t) + StreamMapArray(qw422016, false, ps, t...) //line views/components/view/Any.html:41 - case time.Time: + case util.ToMaps: //line views/components/view/Any.html:42 - StreamTimestamp(qw422016, &t) + StreamMapArray(qw422016, false, ps, t.ToMaps()...) //line views/components/view/Any.html:43 - case *time.Time: + case util.ToOrderedMaps[any]: //line views/components/view/Any.html:44 - StreamTimestamp(qw422016, t) + StreamOrderedMapArray(qw422016, false, ps, t.ToOrderedMaps()...) //line views/components/view/Any.html:45 - case url.URL: + case util.Pkg: //line views/components/view/Any.html:46 - StreamURL(qw422016, t, "", true, ps) + StreamPackage(qw422016, t) //line views/components/view/Any.html:47 - case *url.URL: + case string: //line views/components/view/Any.html:48 - StreamURL(qw422016, t, "", true, ps) + StreamString(qw422016, t) //line views/components/view/Any.html:49 - case uuid.UUID: + case time.Time: //line views/components/view/Any.html:50 - StreamUUID(qw422016, &t) + StreamTimestamp(qw422016, &t) //line views/components/view/Any.html:51 - case *uuid.UUID: + case *time.Time: //line views/components/view/Any.html:52 - StreamUUID(qw422016, t) + StreamTimestamp(qw422016, t) //line views/components/view/Any.html:53 - case []any: + case url.URL: //line views/components/view/Any.html:54 + StreamURL(qw422016, t, "", true, ps) +//line views/components/view/Any.html:55 + case *url.URL: +//line views/components/view/Any.html:56 + StreamURL(qw422016, t, "", true, ps) +//line views/components/view/Any.html:57 + case uuid.UUID: +//line views/components/view/Any.html:58 + StreamUUID(qw422016, &t) +//line views/components/view/Any.html:59 + case *uuid.UUID: +//line views/components/view/Any.html:60 + StreamUUID(qw422016, t) +//line views/components/view/Any.html:61 + case []any: +//line views/components/view/Any.html:62 if len(t) == 0 { -//line views/components/view/Any.html:54 +//line views/components/view/Any.html:62 qw422016.N().S(`empty array`) -//line views/components/view/Any.html:56 +//line views/components/view/Any.html:64 } else { -//line views/components/view/Any.html:57 +//line views/components/view/Any.html:65 arr, extra := util.ArrayLimit(t, 8) -//line views/components/view/Any.html:58 +//line views/components/view/Any.html:66 for idx, e := range arr { -//line views/components/view/Any.html:58 +//line views/components/view/Any.html:66 qw422016.N().S(`
`) -//line views/components/view/Any.html:60 +//line views/components/view/Any.html:68 qw422016.N().D(idx + 1) -//line views/components/view/Any.html:60 +//line views/components/view/Any.html:68 qw422016.N().S(`
`) -//line views/components/view/Any.html:61 +//line views/components/view/Any.html:69 StreamAny(qw422016, e, ps) -//line views/components/view/Any.html:61 +//line views/components/view/Any.html:69 qw422016.N().S(`
`) -//line views/components/view/Any.html:63 +//line views/components/view/Any.html:71 } -//line views/components/view/Any.html:64 +//line views/components/view/Any.html:72 if extra > 0 { -//line views/components/view/Any.html:64 +//line views/components/view/Any.html:72 qw422016.N().S(`
...and`) -//line views/components/view/Any.html:65 +//line views/components/view/Any.html:73 qw422016.N().S(` `) -//line views/components/view/Any.html:65 +//line views/components/view/Any.html:73 qw422016.N().D(extra) -//line views/components/view/Any.html:65 +//line views/components/view/Any.html:73 qw422016.N().S(` `) -//line views/components/view/Any.html:65 +//line views/components/view/Any.html:73 qw422016.N().S(`more
`) -//line views/components/view/Any.html:66 +//line views/components/view/Any.html:74 } -//line views/components/view/Any.html:67 +//line views/components/view/Any.html:75 } -//line views/components/view/Any.html:68 +//line views/components/view/Any.html:76 default: -//line views/components/view/Any.html:68 +//line views/components/view/Any.html:76 qw422016.N().S(`unhandled type [`) -//line views/components/view/Any.html:69 +//line views/components/view/Any.html:77 qw422016.E().S(fmt.Sprintf("%T", x)) -//line views/components/view/Any.html:69 +//line views/components/view/Any.html:77 qw422016.N().S(`]`) -//line views/components/view/Any.html:70 +//line views/components/view/Any.html:78 } -//line views/components/view/Any.html:71 +//line views/components/view/Any.html:79 } -//line views/components/view/Any.html:72 +//line views/components/view/Any.html:80 } -//line views/components/view/Any.html:72 +//line views/components/view/Any.html:80 func WriteAny(qq422016 qtio422016.Writer, x any, ps *cutil.PageState) { -//line views/components/view/Any.html:72 +//line views/components/view/Any.html:80 qw422016 := qt422016.AcquireWriter(qq422016) -//line views/components/view/Any.html:72 +//line views/components/view/Any.html:80 StreamAny(qw422016, x, ps) -//line views/components/view/Any.html:72 +//line views/components/view/Any.html:80 qt422016.ReleaseWriter(qw422016) -//line views/components/view/Any.html:72 +//line views/components/view/Any.html:80 } -//line views/components/view/Any.html:72 +//line views/components/view/Any.html:80 func Any(x any, ps *cutil.PageState) string { -//line views/components/view/Any.html:72 +//line views/components/view/Any.html:80 qb422016 := qt422016.AcquireByteBuffer() -//line views/components/view/Any.html:72 +//line views/components/view/Any.html:80 WriteAny(qb422016, x, ps) -//line views/components/view/Any.html:72 +//line views/components/view/Any.html:80 qs422016 := string(qb422016.B) -//line views/components/view/Any.html:72 +//line views/components/view/Any.html:80 qt422016.ReleaseByteBuffer(qb422016) -//line views/components/view/Any.html:72 +//line views/components/view/Any.html:80 return qs422016 -//line views/components/view/Any.html:72 +//line views/components/view/Any.html:80 } diff --git a/views/components/view/Map.html b/views/components/view/Map.html index e1764757..6a74a223 100644 --- a/views/components/view/Map.html +++ b/views/components/view/Map.html @@ -66,3 +66,59 @@ {%- endif -%} {% endstripspace %}{% endfunc %} + +{% func OrderedMap(preserveWhitespace bool, m *util.OrderedMap[any], ps *cutil.PageState) %}{% stripspace %} + {%- if m == nil -%} + no result + {%- elseif len(m.Map) == 0 -%} + empty result + {%- else -%} +
+ + + {%- for _, k := range m.Order -%} + + + {%- if preserveWhitespace -%} + + {%- else -%} + + {%- endif -%} + + {%- endfor -%} + +
{%s k %}{%= Any(m.GetSimple(k), ps) %}{%= Any(m.GetSimple(k), ps) %}
+
+ {%- endif -%} +{% endstripspace %}{% endfunc %} + +{% func OrderedMapArray(preserveWhitespace bool, ps *cutil.PageState, maps ...*util.OrderedMap[any]) %}{% stripspace %} + {%- if len(maps) == 0 -%} + no results + {%- else -%} +
+ + + + {%- for _, k := range maps[0].Order -%} + + {%- endfor -%} + + + + {%- for _, m := range maps -%} + + {%- for _, k := range m.Order -%} + {%- if preserveWhitespace -%} + + {%- else -%} + + {%- endif -%} + {%- endfor -%} + + {%- endfor -%} + +
{%s k %}
{%= Any(m.GetSimple(k), ps) %}{%= Any(m.GetSimple(k), ps) %}
+
+ {%- endif -%} +{% endstripspace %}{% endfunc %} diff --git a/views/components/view/Map.html.go b/views/components/view/Map.html.go index 89577e3d..2585e3f1 100644 --- a/views/components/view/Map.html.go +++ b/views/components/view/Map.html.go @@ -225,3 +225,165 @@ func MapArray(preserveWhitespace bool, ps *cutil.PageState, maps ...util.ValueMa return qs422016 //line views/components/view/Map.html:68 } + +//line views/components/view/Map.html:70 +func StreamOrderedMap(qw422016 *qt422016.Writer, preserveWhitespace bool, m *util.OrderedMap[any], ps *cutil.PageState) { +//line views/components/view/Map.html:71 + if m == nil { +//line views/components/view/Map.html:71 + qw422016.N().S(`no result`) +//line views/components/view/Map.html:73 + } else if len(m.Map) == 0 { +//line views/components/view/Map.html:73 + qw422016.N().S(`empty result`) +//line views/components/view/Map.html:75 + } else { +//line views/components/view/Map.html:75 + qw422016.N().S(`
`) +//line views/components/view/Map.html:79 + for _, k := range m.Order { +//line views/components/view/Map.html:79 + qw422016.N().S(``) +//line views/components/view/Map.html:82 + if preserveWhitespace { +//line views/components/view/Map.html:82 + qw422016.N().S(``) +//line views/components/view/Map.html:84 + } else { +//line views/components/view/Map.html:84 + qw422016.N().S(``) +//line views/components/view/Map.html:86 + } +//line views/components/view/Map.html:86 + qw422016.N().S(``) +//line views/components/view/Map.html:88 + } +//line views/components/view/Map.html:88 + qw422016.N().S(`
`) +//line views/components/view/Map.html:81 + qw422016.E().S(k) +//line views/components/view/Map.html:81 + qw422016.N().S(``) +//line views/components/view/Map.html:83 + StreamAny(qw422016, m.GetSimple(k), ps) +//line views/components/view/Map.html:83 + qw422016.N().S(``) +//line views/components/view/Map.html:85 + StreamAny(qw422016, m.GetSimple(k), ps) +//line views/components/view/Map.html:85 + qw422016.N().S(`
`) +//line views/components/view/Map.html:92 + } +//line views/components/view/Map.html:93 +} + +//line views/components/view/Map.html:93 +func WriteOrderedMap(qq422016 qtio422016.Writer, preserveWhitespace bool, m *util.OrderedMap[any], ps *cutil.PageState) { +//line views/components/view/Map.html:93 + qw422016 := qt422016.AcquireWriter(qq422016) +//line views/components/view/Map.html:93 + StreamOrderedMap(qw422016, preserveWhitespace, m, ps) +//line views/components/view/Map.html:93 + qt422016.ReleaseWriter(qw422016) +//line views/components/view/Map.html:93 +} + +//line views/components/view/Map.html:93 +func OrderedMap(preserveWhitespace bool, m *util.OrderedMap[any], ps *cutil.PageState) string { +//line views/components/view/Map.html:93 + qb422016 := qt422016.AcquireByteBuffer() +//line views/components/view/Map.html:93 + WriteOrderedMap(qb422016, preserveWhitespace, m, ps) +//line views/components/view/Map.html:93 + qs422016 := string(qb422016.B) +//line views/components/view/Map.html:93 + qt422016.ReleaseByteBuffer(qb422016) +//line views/components/view/Map.html:93 + return qs422016 +//line views/components/view/Map.html:93 +} + +//line views/components/view/Map.html:95 +func StreamOrderedMapArray(qw422016 *qt422016.Writer, preserveWhitespace bool, ps *cutil.PageState, maps ...*util.OrderedMap[any]) { +//line views/components/view/Map.html:96 + if len(maps) == 0 { +//line views/components/view/Map.html:96 + qw422016.N().S(`no results`) +//line views/components/view/Map.html:98 + } else { +//line views/components/view/Map.html:98 + qw422016.N().S(`
`) +//line views/components/view/Map.html:103 + for _, k := range maps[0].Order { +//line views/components/view/Map.html:103 + qw422016.N().S(``) +//line views/components/view/Map.html:105 + } +//line views/components/view/Map.html:105 + qw422016.N().S(``) +//line views/components/view/Map.html:109 + for _, m := range maps { +//line views/components/view/Map.html:109 + qw422016.N().S(``) +//line views/components/view/Map.html:111 + for _, k := range m.Order { +//line views/components/view/Map.html:112 + if preserveWhitespace { +//line views/components/view/Map.html:112 + qw422016.N().S(``) +//line views/components/view/Map.html:114 + } else { +//line views/components/view/Map.html:114 + qw422016.N().S(``) +//line views/components/view/Map.html:116 + } +//line views/components/view/Map.html:117 + } +//line views/components/view/Map.html:117 + qw422016.N().S(``) +//line views/components/view/Map.html:119 + } +//line views/components/view/Map.html:119 + qw422016.N().S(`
`) +//line views/components/view/Map.html:104 + qw422016.E().S(k) +//line views/components/view/Map.html:104 + qw422016.N().S(`
`) +//line views/components/view/Map.html:113 + StreamAny(qw422016, m.GetSimple(k), ps) +//line views/components/view/Map.html:113 + qw422016.N().S(``) +//line views/components/view/Map.html:115 + StreamAny(qw422016, m.GetSimple(k), ps) +//line views/components/view/Map.html:115 + qw422016.N().S(`
`) +//line views/components/view/Map.html:123 + } +//line views/components/view/Map.html:124 +} + +//line views/components/view/Map.html:124 +func WriteOrderedMapArray(qq422016 qtio422016.Writer, preserveWhitespace bool, ps *cutil.PageState, maps ...*util.OrderedMap[any]) { +//line views/components/view/Map.html:124 + qw422016 := qt422016.AcquireWriter(qq422016) +//line views/components/view/Map.html:124 + StreamOrderedMapArray(qw422016, preserveWhitespace, ps, maps...) +//line views/components/view/Map.html:124 + qt422016.ReleaseWriter(qw422016) +//line views/components/view/Map.html:124 +} + +//line views/components/view/Map.html:124 +func OrderedMapArray(preserveWhitespace bool, ps *cutil.PageState, maps ...*util.OrderedMap[any]) string { +//line views/components/view/Map.html:124 + qb422016 := qt422016.AcquireByteBuffer() +//line views/components/view/Map.html:124 + WriteOrderedMapArray(qb422016, preserveWhitespace, ps, maps...) +//line views/components/view/Map.html:124 + qs422016 := string(qb422016.B) +//line views/components/view/Map.html:124 + qt422016.ReleaseByteBuffer(qb422016) +//line views/components/view/Map.html:124 + return qs422016 +//line views/components/view/Map.html:124 +}