Skip to content

Commit e2f503d

Browse files
prepare for v0.0.3
1 parent 415658a commit e2f503d

7 files changed

Lines changed: 55 additions & 11 deletions

File tree

.goreleaser.yaml

Lines changed: 28 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,19 @@ builds:
1919
env:
2020
- CGO_ENABLED=1
2121

22+
- id: httpcache_windows
23+
binary: httpcache
24+
buildmode: "c-shared"
25+
ldflags:
26+
- -s -w -X github.com/walterwanderley/sqlite-http-cache/extension.version={{.Version}} -X github.com/walterwanderley/sqlite-http-cache/extension.commit={{.Commit}} -X github.com/walterwanderley/sqlite-http-cache/extension.date={{.Date}}
27+
goos:
28+
- windows
29+
goarch:
30+
- amd64
31+
env:
32+
- CGO_ENABLED=1
33+
- CC=zig cc -target x86_64-windows
34+
2235
- id: sqlite-http-proxy
2336
main: ./cmd/sqlite-http-proxy
2437
binary: sqlite-http-proxy
@@ -29,6 +42,17 @@ builds:
2942
env:
3043
- CGO_ENABLED=1
3144

45+
- id: sqlite-http-proxy_windows
46+
main: ./cmd/sqlite-http-proxy
47+
binary: sqlite-http-proxy
48+
goos:
49+
- windows
50+
goarch:
51+
- amd64
52+
env:
53+
- CGO_ENABLED=1
54+
- CC=zig cc -target x86_64-windows
55+
3256
- id: sqlite-http-refresh
3357
main: ./cmd/sqlite-http-refresh
3458
binary: sqlite-http-refresh
@@ -37,7 +61,7 @@ builds:
3761
goarch:
3862
- amd64
3963
env:
40-
- CGO_ENABLED=1
64+
- CGO_ENABLED=1
4165

4266
- id: libsql-http-proxy
4367
main: ./cmd/libsql-http-proxy
@@ -52,7 +76,7 @@ builds:
5276
archives:
5377
- id: httpcache
5478
formats: [tar.gz]
55-
ids: [httpcache]
79+
ids: [httpcache, httpcache_windows]
5680
# this name template makes the OS and Arch compatible with the results of `uname`.
5781
name_template: >-
5882
httpcache_
@@ -71,7 +95,7 @@ archives:
7195

7296
- id: sqlite-http-proxy
7397
formats: [tar.gz]
74-
ids: [sqlite-http-proxy]
98+
ids: [sqlite-http-proxy, sqlite-http-proxy_windows]
7599
# this name template makes the OS and Arch compatible with the results of `uname`.
76100
name_template: >-
77101
{{- .Binary }}_
@@ -134,4 +158,4 @@ release:
134158
owner: walterwanderley
135159
name: sqlite-http-cache
136160

137-
draft: true
161+
draft: false
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
package loader
2+
3+
import _ "github.com/walterwanderley/sqlite-http-cache/extension"
4+
5+
// #cgo CFLAGS: -DSQLITE_CORE
6+
// #cgo linux LDFLAGS: -Wl,--unresolved-symbols=ignore-in-object-files
7+
// #cgo darwin LDFLAGS: -Wl,-undefined,dynamic_lookup
8+
// #cgo windows LDFLAGS: -Wl,--allow-multiple-definition
9+
//
10+
// #include "../../../../sqlite3.h"
11+
//
12+
// extern int sqlite3_extension_init(sqlite3*, char**, const sqlite3_api_routines);
13+
import "C"
14+
15+
func init() {
16+
C.sqlite3_auto_extension((*[0]byte)(C.sqlite3_extension_init))
17+
}

cmd/sqlite-http-refresh/main.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,9 @@ import (
1515
"github.com/peterbourgon/ff/v4"
1616
"github.com/peterbourgon/ff/v4/ffhelp"
1717

18+
_ "github.com/walterwanderley/sqlite-http-cache/cmd/sqlite-http-refresh/internal/loader"
1819
"github.com/walterwanderley/sqlite-http-cache/config"
1920
"github.com/walterwanderley/sqlite-http-cache/db"
20-
_ "github.com/walterwanderley/sqlite-http-cache/extension"
2121
)
2222

2323
var (

extension/entrypoint.go

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,16 +8,14 @@ import (
88
// #cgo CFLAGS: -DSQLITE_CORE
99
// #cgo linux LDFLAGS: -Wl,--unresolved-symbols=ignore-in-object-files
1010
// #cgo darwin LDFLAGS: -Wl,-undefined,dynamic_lookup
11-
// #cgo windows LDFLAGS: -Wl,--allow-multiple-definition
1211
//
13-
// #include "sqlite3.h"
12+
// #include "../sqlite3.h"
1413
//
1514
// extern int sqlite3_extension_init(sqlite3*, char**, const sqlite3_api_routines);
1615
import "C"
1716

1817
func init() {
1918
sqlite.Register(registerFunc)
20-
C.sqlite3_auto_extension((*[0]byte)(C.sqlite3_extension_init))
2119
}
2220

2321
func registerFunc(api *sqlite.ExtensionApi) (sqlite.ErrorCode, error) {

main.go

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,11 @@ import (
66

77
import "C"
88

9-
//export main
109
func main() {
1110

1211
}
12+
13+
//export generateHeader
14+
func generateHeader() int {
15+
return 0
16+
}
File renamed without changes.

sqlpkg.json

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,16 @@
11
{
22
"owner": "walterwanderley",
33
"name": "sqlite-http-cache",
4-
"version": "v0.0.2",
4+
"version": "v0.0.3",
55
"repository": "https://github.com/walterwanderley/sqlite-http-cache",
66
"authors": ["Walter Wanderley"],
77
"license": "Apache v2",
88
"description": "SQLite extension to cache HTTP responses",
99
"symbols": ["cache_age", "cache_expired", "cache_expired_ttl", "cache_lifetime", "cache_lifetime_shared", "http_request"],
1010
"assets": {
1111
"files": {
12-
"linux-amd64": "httpcache_0.0.2_Linux_x86_64.tar.gz"
12+
"linux-amd64": "httpcache_0.0.3_Linux_x86_64.tar.gz",
13+
"windows-amd64": "httpcache_0.0.3_Windows_x86_64.zip"
1314
}
1415
}
1516
}

0 commit comments

Comments
 (0)