Skip to content

Commit 2a133aa

Browse files
author
allan
committed
Refactor project structure and update references from go-bard to go-gemini
1 parent 91d7164 commit 2a133aa

File tree

12 files changed

+39
-40
lines changed

12 files changed

+39
-40
lines changed

README.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# go-bard sdk
2-
[![Go build](https://github.com/Allan-Nava/go-bard/actions/workflows/go-build.yml/badge.svg)](https://github.com/Allan-Nava/go-bard/actions/workflows/go-build.yml)
3-
[![Go test workflow](https://github.com/Allan-Nava/go-bard/actions/workflows/go-test.yml/badge.svg)](https://github.com/Allan-Nava/go-bard/actions/workflows/go-test.yml)
2+
[![Go build](https://github.com/Allan-Nava/go-gemini/actions/workflows/go-build.yml/badge.svg)](https://github.com/Allan-Nava/go-gemini/actions/workflows/go-build.yml)
3+
[![Go test workflow](https://github.com/Allan-Nava/go-gemini/actions/workflows/go-test.yml/badge.svg)](https://github.com/Allan-Nava/go-gemini/actions/workflows/go-test.yml)
44

55
A powerful Go package that returns response of Google Bard through API.
66

@@ -12,8 +12,8 @@ A powerful Go package that returns response of Google Bard through API.
1212

1313

1414
### Contributing
15-
We welcome contributions to this project. Please see the [contributing guidelines](https://github.com/Allan-Nava/go-bard/blob/master/CONTRIBUTING.md) for more information.
15+
We welcome contributions to this project. Please see the [contributing guidelines](https://github.com/Allan-Nava/go-gemini/blob/master/CONTRIBUTING.md) for more information.
1616

1717
### License
18-
This project is licensed under the MIT License, Version 2.0. See the [LICENSE](https://github.com/Allan-Nava/go-bard/blob/master/LICENSE) file for more information.
18+
This project is licensed under the MIT License, Version 2.0. See the [LICENSE](https://github.com/Allan-Nava/go-gemini/blob/master/LICENSE) file for more information.
1919

configuration/configuration.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
package configuration
22

33
import (
4-
"github.com/Allan-Nava/go-bard/constants"
4+
"github.com/Allan-Nava/go-gemini/constants"
55
"github.com/caarlos0/env/v6"
66
)
77

docs/_config.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ heading_anchors: true
5656
# Aux links for the upper right navigation
5757
aux_links:
5858
"go-bard":
59-
- "//github.com/Allan-Nava/go-bard"
59+
- "//github.com/Allan-Nava/go-gemini"
6060
#
6161
# Makes Aux links open in a new tab. Default is false
6262
aux_links_new_tab: true
@@ -70,7 +70,7 @@ nav_sort: case_insensitive # default, equivalent to nil
7070
back_to_top: true
7171
back_to_top_text: "Back to top"
7272
#
73-
footer_content: "Copyright &copy; 2022-present go-bard . Distributed by Github <a href=\"https://github.com/Allan-Nava/go-bard/blob/main/LICENSE.md>MIT license.</a>"
73+
footer_content: "Copyright &copy; 2022-present go-bard . Distributed by Github <a href=\"https://github.com/Allan-Nava/go-gemini/blob/main/LICENSE.md>MIT license.</a>"
7474
#
7575
# Footer last edited timestamp
7676
last_edit_timestamp: true # show or hide edit time - page must have `last_modified_date` defined in the frontmatter

docs/index.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ A powerful golang sdk library for interacting with the Bard API easily
1919

2020

2121
### Contributing
22-
We welcome contributions to this project. Please see the [contributing guidelines](https://github.com/Allan-Nava/go-bard/blob/master/CONTRIBUTING.md) for more information.
22+
We welcome contributions to this project. Please see the [contributing guidelines](https://github.com/Allan-Nava/go-gemini/blob/master/CONTRIBUTING.md) for more information.
2323

2424
### License
25-
This project is licensed under the MIT License, Version 2.0. See the [LICENSE](https://github.com/Allan-Nava/go-bard/blob/master/LICENSE) file for more information.
25+
This project is licensed under the MIT License, Version 2.0. See the [LICENSE](https://github.com/Allan-Nava/go-gemini/blob/master/LICENSE) file for more information.

go.mod

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
module github.com/Allan-Nava/go-bard
1+
module github.com/Allan-Nava/go-gemini
22

3-
go 1.18
3+
go 1.21
44

55
require (
66
github.com/caarlos0/env/v6 v6.10.1 // indirect

gobard/api.go

Lines changed: 0 additions & 7 deletions
This file was deleted.

gobard/response.go

Lines changed: 0 additions & 1 deletion
This file was deleted.

gogemini/api.go

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
package gogemini
2+
3+
func (o *gemini) GetAnswer() error {
4+
5+
return nil
6+
}
Lines changed: 13 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,27 @@
1-
package gobard
1+
package gogemini
22

33
import (
44
"log"
5-
"github.com/Allan-Nava/go-bard/configuration"
6-
"github.com/Allan-Nava/go-bard/constants"
5+
6+
"github.com/Allan-Nava/go-gemini/configuration"
7+
"github.com/Allan-Nava/go-gemini/constants"
78
"github.com/go-resty/resty/v2"
89
)
910

10-
type IGoBard interface {
11+
type IGoGemini interface {
1112
// api
1213
GetAnswer() error
1314
//
1415
}
1516

16-
type gobard struct {
17+
type gemini struct {
1718
configuration *configuration.Configuration
1819
restClient *resty.Client
19-
sNlM0e string
20+
sNlM0e string
2021
}
2122

22-
func NewGoBoard(configuration *configuration.Configuration) IGoBard {
23-
g := &gobard{
23+
func NewGoGemini(configuration *configuration.Configuration) IGoGemini {
24+
g := &gemini{
2425
configuration: configuration,
2526
}
2627
g.restClient = resty.New()
@@ -47,7 +48,7 @@ func NewGoBoard(configuration *configuration.Configuration) IGoBard {
4748

4849
// Resty Methods
4950

50-
func (o *gobard) restyPost(url string, body interface{}) (*resty.Response, error) {
51+
func (o *gemini) restyPost(url string, body interface{}) (*resty.Response, error) {
5152
resp, err := o.restClient.R().
5253
SetHeader("Accept", "application/json").
5354
SetBody(body).
@@ -59,7 +60,7 @@ func (o *gobard) restyPost(url string, body interface{}) (*resty.Response, error
5960
return resp, nil
6061
}
6162

62-
func (o *gobard) restyGet(url string, queryParams map[string]string) (*resty.Response, error) {
63+
func (o *gemini) restyGet(url string, queryParams map[string]string) (*resty.Response, error) {
6364
resp, err := o.restClient.R().
6465
SetQueryParams(queryParams).
6566
Get(url)
@@ -72,12 +73,12 @@ func (o *gobard) restyGet(url string, queryParams map[string]string) (*resty.Res
7273

7374
// internal api
7475
// _get_snim0e
75-
func(o *gobard) getSnim0e() error {
76+
func (o *gemini) getSnim0e() error {
7677
resp, err := o.restyGet("/", nil)
7778
if err != nil {
7879
return err
7980
}
8081
log.Println("resp ", resp)
8182
// re.search(r"SNlM0e\":\"(.*?)\"", resp.text).group(1)
8283
return nil
83-
}
84+
}
Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
1-
package gobard
2-
1+
package gogemini
32

43
type RequestGetAnswer struct {
5-
At string `json:"at" required:"true" validate:"nonnil,min=1"`
4+
At string `json:"at" required:"true" validate:"nonnil,min=1"`
65
FReq string `json:"f.req" required:"true" validate:"nonnil,min=1"`
7-
}
6+
}

0 commit comments

Comments
 (0)