repos / pico

pico services - prose.sh, pastes.sh, imgs.sh, feeds.sh, pgs.sh
git clone https://github.com/picosh/pico.git

commit
0e7eac3
parent
efd5af1
author
Antonio Mika
date
2023-11-08 23:48:28 +0000 UTC
Fix deprecations
12 files changed,  +29, -29
M go.mod
M go.sum
M go.mod
+1, -1
1@@ -111,7 +111,7 @@ require (
2 	github.com/yusufpapurcu/wmi v1.2.3 // indirect
3 	go.uber.org/multierr v1.11.0 // indirect
4 	golang.org/x/image v0.14.0 // indirect
5-	golang.org/x/net v0.17.0 // indirect
6+	golang.org/x/net v0.18.0 // indirect
7 	golang.org/x/sync v0.5.0 // indirect
8 	golang.org/x/sys v0.14.0 // indirect
9 	golang.org/x/term v0.14.0 // indirect
M go.sum
+2, -2
 1@@ -292,8 +292,8 @@ golang.org/x/net v0.1.0/go.mod h1:Cx3nUiGt4eDBEyega/BKRp+/AlGL8hYe7U9odMt2Cco=
 2 golang.org/x/net v0.6.0/go.mod h1:2Tu9+aMcznHK/AK1HMvgo6xiTLG5rD5rZLDS+rp2Bjs=
 3 golang.org/x/net v0.7.0/go.mod h1:2Tu9+aMcznHK/AK1HMvgo6xiTLG5rD5rZLDS+rp2Bjs=
 4 golang.org/x/net v0.9.0/go.mod h1:d48xBJpPfHeWQsugry2m+kC02ZBRGRgulfHnEXEuWns=
 5-golang.org/x/net v0.17.0 h1:pVaXccu2ozPjCXewfr1S7xza/zcXTity9cCdXQYSjIM=
 6-golang.org/x/net v0.17.0/go.mod h1:NxSsAGuq816PNPmqtQdLE42eU2Fs7NoRIZrHJAlaCOE=
 7+golang.org/x/net v0.18.0 h1:mIYleuAkSbHh0tCv7RvjL3F6ZVbLjq4+R7zbOn3Kokg=
 8+golang.org/x/net v0.18.0/go.mod h1:/czyP5RqHAH4odGYxBJ1qz0+CE5WZ+2j1YgoEo8F2jQ=
 9 golang.org/x/sync v0.0.0-20181221193216-37e7f081c4d4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
10 golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
11 golang.org/x/sync v0.0.0-20220722155255-886fb9371eb4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
M pgs/cms.go
+2, -2
 1@@ -70,7 +70,7 @@ var (
 2 )
 3 
 4 func NewSpinner() spinner.Model {
 5-	s := spinner.NewModel()
 6+	s := spinner.New()
 7 	s.Spinner = spinner.Dot
 8 	s.Style = spinnerStyle
 9 	return s
10@@ -154,7 +154,7 @@ type model struct {
11 }
12 
13 func (m model) Init() tea.Cmd {
14-	return spinner.Tick
15+	return m.spinner.Tick
16 }
17 
18 func (m model) findUser() (*db.User, error) {
M wish/cms/cms.go
+2, -2
 1@@ -79,7 +79,7 @@ var (
 2 )
 3 
 4 func NewSpinner() spinner.Model {
 5-	s := spinner.NewModel()
 6+	s := spinner.New()
 7 	s.Spinner = spinner.Dot
 8 	s.Style = spinnerStyle
 9 	return s
10@@ -165,7 +165,7 @@ type model struct {
11 }
12 
13 func (m model) Init() tea.Cmd {
14-	return spinner.Tick
15+	return m.spinner.Tick
16 }
17 
18 func (m model) findUser() (*db.User, error) {
M wish/cms/ui/account/create.go
+3, -3
 1@@ -94,8 +94,8 @@ func (m *CreateModel) indexBackward() {
 2 func NewCreateModel(cfg *config.ConfigCms, dbpool db.DB, publicKey string) CreateModel {
 3 	st := common.DefaultStyles()
 4 
 5-	im := input.NewModel()
 6-	im.CursorStyle = st.Cursor
 7+	im := input.New()
 8+	im.Cursor.Style = st.Cursor
 9 	im.Placeholder = "erock"
10 	im.Prompt = st.FocusedPrompt.String()
11 	im.CharLimit = 50
12@@ -176,7 +176,7 @@ func Update(msg tea.Msg, m CreateModel) (CreateModel, tea.Cmd) {
13 
14 					return m, tea.Batch(
15 						createAccount(m), // fire off the command, too
16-						spinner.Tick,
17+						m.spinner.Tick,
18 					)
19 				case cancelButton: // Exit
20 					m.Quit = true
M wish/cms/ui/common/views.go
+1, -1
1@@ -77,7 +77,7 @@ func KeyValueView(stuff ...string) string {
2 
3 // NewSpinner returns a spinner model.
4 func NewSpinner() spinner.Model {
5-	s := spinner.NewModel()
6+	s := spinner.New()
7 	s.Spinner = spinner.Dot
8 	s.Style = spinnerStyle
9 	return s
M wish/cms/ui/createkey/create.go
+3, -3
 1@@ -88,8 +88,8 @@ func (m *Model) indexBackward() {
 2 func NewModel(cfg *config.ConfigCms, dbpool db.DB, user *db.User) Model {
 3 	st := common.DefaultStyles()
 4 
 5-	im := input.NewModel()
 6-	im.CursorStyle = st.Cursor
 7+	im := input.New()
 8+	im.Cursor.Style = st.Cursor
 9 	im.Placeholder = "ssh-ed25519 AAAA..."
10 	im.Prompt = st.FocusedPrompt.String()
11 	im.CharLimit = 2049
12@@ -164,7 +164,7 @@ func (m Model) Update(msg tea.Msg) (tea.Model, tea.Cmd) {
13 
14 					return m, tea.Batch(
15 						addPublicKey(m), // fire off the command, too
16-						spinner.Tick,
17+						m.spinner.Tick,
18 					)
19 				case cancelButton: // Exit this mini-app
20 					m.Done = true
M wish/cms/ui/createtoken/create.go
+3, -3
 1@@ -92,8 +92,8 @@ func (m *Model) indexBackward() {
 2 func NewModel(cfg *config.ConfigCms, dbpool db.DB, user *db.User) Model {
 3 	st := common.DefaultStyles()
 4 
 5-	im := input.NewModel()
 6-	im.CursorStyle = st.Cursor
 7+	im := input.New()
 8+	im.Cursor.Style = st.Cursor
 9 	im.Placeholder = "A name used for your reference"
10 	im.Prompt = st.FocusedPrompt.String()
11 	im.CharLimit = 256
12@@ -176,7 +176,7 @@ func (m Model) Update(msg tea.Msg) (tea.Model, tea.Cmd) {
13 
14 					return m, tea.Batch(
15 						addToken(m), // fire off the command, too
16-						spinner.Tick,
17+						m.spinner.Tick,
18 					)
19 				case cancelButton: // Exit this mini-app
20 					m.Done = true
M wish/cms/ui/keys/keys.go
+3, -3
 1@@ -85,7 +85,7 @@ func (m *Model) UpdatePaging(msg tea.Msg) {
 2 func NewModel(cfg *config.ConfigCms, dbpool db.DB, user *db.User) Model {
 3 	st := common.DefaultStyles()
 4 
 5-	p := pager.NewModel()
 6+	p := pager.New()
 7 	p.PerPage = keysPerPage
 8 	p.Type = pager.Dots
 9 	p.InactiveDot = st.InactivePagination.Render("•")
10@@ -110,7 +110,7 @@ func NewModel(cfg *config.ConfigCms, dbpool db.DB, user *db.User) Model {
11 // Init is the Tea initialization function.
12 func (m Model) Init() tea.Cmd {
13 	return tea.Batch(
14-		spinner.Tick,
15+		m.spinner.Tick,
16 	)
17 }
18 
19@@ -381,7 +381,7 @@ func (m Model) promptView(prompt string) string {
20 func LoadKeys(m Model) tea.Cmd {
21 	return tea.Batch(
22 		fetchKeys(m.dbpool, m.user),
23-		spinner.Tick,
24+		m.spinner.Tick,
25 	)
26 }
27 
M wish/cms/ui/posts/posts.go
+3, -3
 1@@ -88,7 +88,7 @@ func NewModel(cfg *config.ConfigCms, urls config.ConfigURL, dbpool db.DB, user *
 2 	logger := cfg.Logger
 3 	st := common.DefaultStyles()
 4 
 5-	p := pager.NewModel()
 6+	p := pager.New()
 7 	p.PerPage = keysPerPage
 8 	p.Type = pager.Dots
 9 	p.InactiveDot = st.InactivePagination.Render("•")
10@@ -115,7 +115,7 @@ func NewModel(cfg *config.ConfigCms, urls config.ConfigURL, dbpool db.DB, user *
11 // Init is the Tea initialization function.
12 func (m Model) Init() tea.Cmd {
13 	return tea.Batch(
14-		spinner.Tick,
15+		m.spinner.Tick,
16 	)
17 }
18 
19@@ -315,7 +315,7 @@ func LoadPosts(m Model) tea.Cmd {
20 
21 	return tea.Batch(
22 		m.fetchPosts(m.user.ID),
23-		spinner.Tick,
24+		m.spinner.Tick,
25 	)
26 }
27 
M wish/cms/ui/tokens/tokens.go
+3, -3
 1@@ -83,7 +83,7 @@ func (m *Model) UpdatePaging(msg tea.Msg) {
 2 func NewModel(cfg *config.ConfigCms, dbpool db.DB, user *db.User) Model {
 3 	st := common.DefaultStyles()
 4 
 5-	p := pager.NewModel()
 6+	p := pager.New()
 7 	p.PerPage = keysPerPage
 8 	p.Type = pager.Dots
 9 	p.InactiveDot = st.InactivePagination.Render("•")
10@@ -108,7 +108,7 @@ func NewModel(cfg *config.ConfigCms, dbpool db.DB, user *db.User) Model {
11 // Init is the Tea initialization function.
12 func (m Model) Init() tea.Cmd {
13 	return tea.Batch(
14-		spinner.Tick,
15+		m.spinner.Tick,
16 	)
17 }
18 
19@@ -349,7 +349,7 @@ func (m Model) promptView(prompt string) string {
20 func LoadKeys(m Model) tea.Cmd {
21 	return tea.Batch(
22 		fetchKeys(m.dbpool, m.user),
23-		spinner.Tick,
24+		m.spinner.Tick,
25 	)
26 }
27 
M wish/cms/ui/username/username.go
+3, -3
 1@@ -94,8 +94,8 @@ func (m *Model) indexBackward() {
 2 func NewModel(dbpool db.DB, user *db.User, sshUser string) Model {
 3 	st := common.DefaultStyles()
 4 
 5-	im := input.NewModel()
 6-	im.CursorStyle = st.Cursor
 7+	im := input.New()
 8+	im.Cursor.Style = st.Cursor
 9 	im.Placeholder = sshUser
10 	im.Prompt = st.FocusedPrompt.String()
11 	im.CharLimit = 50
12@@ -178,7 +178,7 @@ func Update(msg tea.Msg, m Model) (Model, tea.Cmd) {
13 
14 					return m, tea.Batch(
15 						setName(m), // fire off the command, too
16-						spinner.Tick,
17+						m.spinner.Tick,
18 					)
19 				case cancelButton: // Exit this mini-app
20 					m.Done = true