Skip to content

Commit

Permalink
updates
Browse files Browse the repository at this point in the history
  • Loading branch information
KenWilliamson committed Sep 6, 2023
1 parent 8424de9 commit adbf32e
Show file tree
Hide file tree
Showing 28 changed files with 3,257 additions and 275 deletions.
124 changes: 76 additions & 48 deletions delegates/coverage.out
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,17 @@ github.com/Ulbora/go-micro-blog-ui/delegates/configDelegate.go:38.56,41.16 3 1
github.com/Ulbora/go-micro-blog-ui/delegates/configDelegate.go:41.16,43.17 2 1
github.com/Ulbora/go-micro-blog-ui/delegates/configDelegate.go:43.17,48.4 4 1
github.com/Ulbora/go-micro-blog-ui/delegates/configDelegate.go:50.2,51.13 2 1
github.com/Ulbora/go-micro-blog-ui/delegates/homeDelegate.go:26.51,29.16 3 1
github.com/Ulbora/go-micro-blog-ui/delegates/homeDelegate.go:29.16,31.17 2 1
github.com/Ulbora/go-micro-blog-ui/delegates/homeDelegate.go:31.17,36.4 4 1
github.com/Ulbora/go-micro-blog-ui/delegates/homeDelegate.go:38.2,39.15 2 1
github.com/Ulbora/go-micro-blog-ui/delegates/homeDelegate.go:43.52,46.16 3 1
github.com/Ulbora/go-micro-blog-ui/delegates/homeDelegate.go:46.16,48.17 2 1
github.com/Ulbora/go-micro-blog-ui/delegates/homeDelegate.go:48.17,53.4 4 1
github.com/Ulbora/go-micro-blog-ui/delegates/homeDelegate.go:55.2,56.15 2 1
github.com/Ulbora/go-micro-blog-ui/delegates/homeDelegate.go:60.38,63.16 3 1
github.com/Ulbora/go-micro-blog-ui/delegates/homeDelegate.go:63.16,67.3 3 1
github.com/Ulbora/go-micro-blog-ui/delegates/homeDelegate.go:68.2,68.13 1 1
github.com/Ulbora/go-micro-blog-ui/delegates/likeDelegate.go:27.51,30.16 3 1
github.com/Ulbora/go-micro-blog-ui/delegates/likeDelegate.go:30.16,32.17 2 1
github.com/Ulbora/go-micro-blog-ui/delegates/likeDelegate.go:32.17,37.4 4 1
Expand All @@ -92,54 +103,71 @@ github.com/Ulbora/go-micro-blog-ui/delegates/mcDelegate.go:75.2,75.25 1 1
github.com/Ulbora/go-micro-blog-ui/delegates/mcDelegate.go:75.25,77.3 1 1
github.com/Ulbora/go-micro-blog-ui/delegates/mcDelegate.go:77.8,79.3 1 1
github.com/Ulbora/go-micro-blog-ui/delegates/mcDelegate.go:80.2,80.17 1 1
github.com/Ulbora/go-micro-blog-ui/delegates/mockDelegate.go:107.39,109.2 1 1
github.com/Ulbora/go-micro-blog-ui/delegates/mockDelegate.go:112.53,114.2 1 1
github.com/Ulbora/go-micro-blog-ui/delegates/mockDelegate.go:117.54,120.2 1 1
github.com/Ulbora/go-micro-blog-ui/delegates/mockDelegate.go:123.52,126.2 1 1
github.com/Ulbora/go-micro-blog-ui/delegates/mockDelegate.go:129.52,132.2 1 1
github.com/Ulbora/go-micro-blog-ui/delegates/mockDelegate.go:135.46,138.2 1 1
github.com/Ulbora/go-micro-blog-ui/delegates/mockDelegate.go:141.57,144.2 1 1
github.com/Ulbora/go-micro-blog-ui/delegates/mockDelegate.go:147.52,150.2 1 1
github.com/Ulbora/go-micro-blog-ui/delegates/mockDelegate.go:153.54,155.2 1 1
github.com/Ulbora/go-micro-blog-ui/delegates/mockDelegate.go:158.55,161.2 1 1
github.com/Ulbora/go-micro-blog-ui/delegates/mockDelegate.go:164.63,167.2 1 1
github.com/Ulbora/go-micro-blog-ui/delegates/mockDelegate.go:170.58,173.2 1 1
github.com/Ulbora/go-micro-blog-ui/delegates/mockDelegate.go:176.53,178.2 1 1
github.com/Ulbora/go-micro-blog-ui/delegates/mockDelegate.go:181.51,183.2 1 1
github.com/Ulbora/go-micro-blog-ui/delegates/mockDelegate.go:186.46,188.2 1 1
github.com/Ulbora/go-micro-blog-ui/delegates/mockDelegate.go:191.56,193.2 1 1
github.com/Ulbora/go-micro-blog-ui/delegates/mockDelegate.go:196.53,198.2 1 1
github.com/Ulbora/go-micro-blog-ui/delegates/mockDelegate.go:201.54,203.2 1 1
github.com/Ulbora/go-micro-blog-ui/delegates/mockDelegate.go:206.49,208.2 1 1
github.com/Ulbora/go-micro-blog-ui/delegates/mockDelegate.go:211.83,213.2 1 1
github.com/Ulbora/go-micro-blog-ui/delegates/mockDelegate.go:216.88,218.2 1 1
github.com/Ulbora/go-micro-blog-ui/delegates/mockDelegate.go:221.68,223.2 1 1
github.com/Ulbora/go-micro-blog-ui/delegates/mockDelegate.go:226.73,228.2 1 1
github.com/Ulbora/go-micro-blog-ui/delegates/mockDelegate.go:231.56,233.2 1 1
github.com/Ulbora/go-micro-blog-ui/delegates/mockDelegate.go:236.58,238.2 1 1
github.com/Ulbora/go-micro-blog-ui/delegates/mockDelegate.go:241.56,243.2 1 1
github.com/Ulbora/go-micro-blog-ui/delegates/mockDelegate.go:246.53,248.2 1 1
github.com/Ulbora/go-micro-blog-ui/delegates/mockDelegate.go:251.54,253.2 1 1
github.com/Ulbora/go-micro-blog-ui/delegates/mockDelegate.go:256.53,258.2 1 1
github.com/Ulbora/go-micro-blog-ui/delegates/mockDelegate.go:261.59,263.2 1 1
github.com/Ulbora/go-micro-blog-ui/delegates/mockDelegate.go:266.60,268.2 1 1
github.com/Ulbora/go-micro-blog-ui/delegates/mockDelegate.go:271.88,273.2 1 1
github.com/Ulbora/go-micro-blog-ui/delegates/mockDelegate.go:276.93,278.2 1 1
github.com/Ulbora/go-micro-blog-ui/delegates/mockDelegate.go:281.62,283.2 1 1
github.com/Ulbora/go-micro-blog-ui/delegates/mockDelegate.go:286.64,288.2 1 1
github.com/Ulbora/go-micro-blog-ui/delegates/mockDelegate.go:291.61,293.2 1 1
github.com/Ulbora/go-micro-blog-ui/delegates/mockDelegate.go:296.90,298.2 1 1
github.com/Ulbora/go-micro-blog-ui/delegates/mockDelegate.go:301.58,303.2 1 1
github.com/Ulbora/go-micro-blog-ui/delegates/mockDelegate.go:306.44,308.2 1 1
github.com/Ulbora/go-micro-blog-ui/delegates/mockDelegate.go:311.53,313.2 1 1
github.com/Ulbora/go-micro-blog-ui/delegates/mockDelegate.go:316.54,318.2 1 1
github.com/Ulbora/go-micro-blog-ui/delegates/mockDelegate.go:321.40,323.2 1 1
github.com/Ulbora/go-micro-blog-ui/delegates/mockDelegate.go:326.55,328.2 1 1
github.com/Ulbora/go-micro-blog-ui/delegates/mockDelegate.go:331.56,333.2 1 1
github.com/Ulbora/go-micro-blog-ui/delegates/mockDelegate.go:336.42,338.2 1 1
github.com/Ulbora/go-micro-blog-ui/delegates/mockDelegate.go:341.55,343.2 1 1
github.com/Ulbora/go-micro-blog-ui/delegates/mockDelegate.go:346.56,348.2 1 1
github.com/Ulbora/go-micro-blog-ui/delegates/mockDelegate.go:351.42,353.2 1 1
github.com/Ulbora/go-micro-blog-ui/delegates/mockDelegate.go:119.39,121.2 1 1
github.com/Ulbora/go-micro-blog-ui/delegates/mockDelegate.go:124.53,126.2 1 1
github.com/Ulbora/go-micro-blog-ui/delegates/mockDelegate.go:129.54,132.2 1 1
github.com/Ulbora/go-micro-blog-ui/delegates/mockDelegate.go:135.52,138.2 1 1
github.com/Ulbora/go-micro-blog-ui/delegates/mockDelegate.go:141.52,144.2 1 1
github.com/Ulbora/go-micro-blog-ui/delegates/mockDelegate.go:147.46,150.2 1 1
github.com/Ulbora/go-micro-blog-ui/delegates/mockDelegate.go:153.57,156.2 1 1
github.com/Ulbora/go-micro-blog-ui/delegates/mockDelegate.go:159.52,162.2 1 1
github.com/Ulbora/go-micro-blog-ui/delegates/mockDelegate.go:165.54,167.2 1 1
github.com/Ulbora/go-micro-blog-ui/delegates/mockDelegate.go:170.55,173.2 1 1
github.com/Ulbora/go-micro-blog-ui/delegates/mockDelegate.go:176.63,179.2 1 1
github.com/Ulbora/go-micro-blog-ui/delegates/mockDelegate.go:182.58,185.2 1 1
github.com/Ulbora/go-micro-blog-ui/delegates/mockDelegate.go:188.53,190.2 1 1
github.com/Ulbora/go-micro-blog-ui/delegates/mockDelegate.go:193.51,195.2 1 1
github.com/Ulbora/go-micro-blog-ui/delegates/mockDelegate.go:198.46,200.2 1 1
github.com/Ulbora/go-micro-blog-ui/delegates/mockDelegate.go:203.56,205.2 1 1
github.com/Ulbora/go-micro-blog-ui/delegates/mockDelegate.go:208.53,210.2 1 1
github.com/Ulbora/go-micro-blog-ui/delegates/mockDelegate.go:213.54,215.2 1 1
github.com/Ulbora/go-micro-blog-ui/delegates/mockDelegate.go:218.49,220.2 1 1
github.com/Ulbora/go-micro-blog-ui/delegates/mockDelegate.go:223.83,225.2 1 1
github.com/Ulbora/go-micro-blog-ui/delegates/mockDelegate.go:228.88,230.2 1 1
github.com/Ulbora/go-micro-blog-ui/delegates/mockDelegate.go:233.68,235.2 1 1
github.com/Ulbora/go-micro-blog-ui/delegates/mockDelegate.go:238.73,240.2 1 1
github.com/Ulbora/go-micro-blog-ui/delegates/mockDelegate.go:243.56,245.2 1 1
github.com/Ulbora/go-micro-blog-ui/delegates/mockDelegate.go:248.58,250.2 1 1
github.com/Ulbora/go-micro-blog-ui/delegates/mockDelegate.go:253.56,255.2 1 1
github.com/Ulbora/go-micro-blog-ui/delegates/mockDelegate.go:258.53,260.2 1 1
github.com/Ulbora/go-micro-blog-ui/delegates/mockDelegate.go:263.54,265.2 1 1
github.com/Ulbora/go-micro-blog-ui/delegates/mockDelegate.go:268.53,270.2 1 1
github.com/Ulbora/go-micro-blog-ui/delegates/mockDelegate.go:273.59,275.2 1 1
github.com/Ulbora/go-micro-blog-ui/delegates/mockDelegate.go:278.60,280.2 1 1
github.com/Ulbora/go-micro-blog-ui/delegates/mockDelegate.go:283.88,285.2 1 1
github.com/Ulbora/go-micro-blog-ui/delegates/mockDelegate.go:288.93,290.2 1 1
github.com/Ulbora/go-micro-blog-ui/delegates/mockDelegate.go:293.62,295.2 1 1
github.com/Ulbora/go-micro-blog-ui/delegates/mockDelegate.go:298.64,300.2 1 1
github.com/Ulbora/go-micro-blog-ui/delegates/mockDelegate.go:303.61,305.2 1 1
github.com/Ulbora/go-micro-blog-ui/delegates/mockDelegate.go:308.90,310.2 1 1
github.com/Ulbora/go-micro-blog-ui/delegates/mockDelegate.go:313.58,315.2 1 1
github.com/Ulbora/go-micro-blog-ui/delegates/mockDelegate.go:318.44,320.2 1 1
github.com/Ulbora/go-micro-blog-ui/delegates/mockDelegate.go:323.53,325.2 1 1
github.com/Ulbora/go-micro-blog-ui/delegates/mockDelegate.go:328.54,330.2 1 1
github.com/Ulbora/go-micro-blog-ui/delegates/mockDelegate.go:333.40,335.2 1 1
github.com/Ulbora/go-micro-blog-ui/delegates/mockDelegate.go:338.55,340.2 1 1
github.com/Ulbora/go-micro-blog-ui/delegates/mockDelegate.go:343.56,345.2 1 1
github.com/Ulbora/go-micro-blog-ui/delegates/mockDelegate.go:348.42,350.2 1 1
github.com/Ulbora/go-micro-blog-ui/delegates/mockDelegate.go:353.55,355.2 1 1
github.com/Ulbora/go-micro-blog-ui/delegates/mockDelegate.go:358.56,360.2 1 1
github.com/Ulbora/go-micro-blog-ui/delegates/mockDelegate.go:363.42,365.2 1 1
github.com/Ulbora/go-micro-blog-ui/delegates/mockDelegate.go:368.53,370.2 1 1
github.com/Ulbora/go-micro-blog-ui/delegates/mockDelegate.go:373.54,375.2 1 1
github.com/Ulbora/go-micro-blog-ui/delegates/mockDelegate.go:378.40,380.2 1 1
github.com/Ulbora/go-micro-blog-ui/delegates/mockDelegate.go:383.71,385.2 1 1
github.com/Ulbora/go-micro-blog-ui/delegates/mockDelegate.go:388.72,390.2 1 1
github.com/Ulbora/go-micro-blog-ui/delegates/mockDelegate.go:393.58,395.2 1 1
github.com/Ulbora/go-micro-blog-ui/delegates/privacyPolicyDelegate.go:26.69,29.16 3 1
github.com/Ulbora/go-micro-blog-ui/delegates/privacyPolicyDelegate.go:29.16,31.17 2 1
github.com/Ulbora/go-micro-blog-ui/delegates/privacyPolicyDelegate.go:31.17,36.4 4 1
github.com/Ulbora/go-micro-blog-ui/delegates/privacyPolicyDelegate.go:38.2,39.15 2 1
github.com/Ulbora/go-micro-blog-ui/delegates/privacyPolicyDelegate.go:43.70,46.16 3 1
github.com/Ulbora/go-micro-blog-ui/delegates/privacyPolicyDelegate.go:46.16,48.17 2 1
github.com/Ulbora/go-micro-blog-ui/delegates/privacyPolicyDelegate.go:48.17,53.4 4 1
github.com/Ulbora/go-micro-blog-ui/delegates/privacyPolicyDelegate.go:55.2,56.15 2 1
github.com/Ulbora/go-micro-blog-ui/delegates/privacyPolicyDelegate.go:60.56,63.16 3 1
github.com/Ulbora/go-micro-blog-ui/delegates/privacyPolicyDelegate.go:63.16,67.3 3 1
github.com/Ulbora/go-micro-blog-ui/delegates/privacyPolicyDelegate.go:68.2,68.13 1 1
github.com/Ulbora/go-micro-blog-ui/delegates/roleDelegate.go:27.51,30.16 3 1
github.com/Ulbora/go-micro-blog-ui/delegates/roleDelegate.go:30.16,32.17 2 1
github.com/Ulbora/go-micro-blog-ui/delegates/roleDelegate.go:32.17,37.4 4 1
Expand Down
8 changes: 8 additions & 0 deletions delegates/delegate.go
Original file line number Diff line number Diff line change
Expand Up @@ -84,4 +84,12 @@ type Delegate interface {
AddAbout(r *About) *ResponseID
UpdateAbout(r *About) *Response
GetAbout() *About

AddHome(r *Home) *ResponseID
UpdateHome(r *Home) *Response
GetHome() *Home

AddPrivacyPolicy(r *PrivacyPolicy) *ResponseID
UpdatePrivacyPolicy(r *PrivacyPolicy) *Response
GetPrivacyPolicy() *PrivacyPolicy
}
69 changes: 69 additions & 0 deletions delegates/homeDelegate.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
package delegates

import (
"encoding/json"
"net/http"
)

/*
Copyright (C) 2023 Ulbora Labs LLC. (www.ulboralabs.com)
All rights reserved.
Copyright (C) 2023 Ken Williamson
All rights reserved.
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/

// AddHome AddHome
func (d *MCDelegate) AddHome(a *Home) *ResponseID {
var arrtn ResponseID
aJSON, err := json.Marshal(a)
if err == nil {
aarq, err := d.buildRequest(http.MethodPost, "/rs/home/add", aJSON, adminKey)
if err == nil {
aasuc, stat := d.proxy.Do(aarq, &arrtn)
arrtn.Code = int64(stat)
d.Log.Debug("suc: ", aasuc)
d.Log.Debug("stat: ", stat)
}
}
d.Log.Debug("rtn: ", arrtn)
return &arrtn
}

// UpdateHome UpdateHome
func (d *MCDelegate) UpdateHome(r *Home) *Response {
var uartn Response
aJSON, err := json.Marshal(r)
if err == nil {
rq, err := d.buildRequest(http.MethodPut, "/rs/home/update", aJSON, adminKey)
if err == nil {
usuc, stat := d.proxy.Do(rq, &uartn)
uartn.Code = int64(stat)
d.Log.Debug("suc: ", usuc)
d.Log.Debug("stat: ", stat)
}
}
d.Log.Debug("rtn: ", uartn)
return &uartn
}

// GetHome GetHome
func (d *MCDelegate) GetHome() *Home {
var rtn Home
arq, err := d.buildRequest(http.MethodGet, "/rs/home/get", nil, adminKey)
if err == nil {
gasuc, stat := d.proxy.Do(arq, &rtn)
d.Log.Debug("suc: ", gasuc)
d.Log.Debug("stat: ", stat)
}
return &rtn
}
Loading

0 comments on commit adbf32e

Please sign in to comment.