Skip to content

Commit 3976a6f

Browse files
authored
rename the dagger module to localstack (#1)
1 parent 17d17db commit 3976a6f

File tree

12 files changed

+42
-199
lines changed

12 files changed

+42
-199
lines changed

.dagger/pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
[project]
2-
name = "localstack-dagger-module"
2+
name = "localstack"
33
version = "0.1.0"
44
requires-python = ">=3.10"
55
dependencies = ["dagger-io", "requests"]

.dagger/src/localstack_dagger_module/__init__.py renamed to .dagger/src/localstack/__init__.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
"""A generated module for LocalstackDaggerModule functions
1+
"""A generated module for Localstack functions
22
33
This module has been generated via dagger init and serves as a reference to
44
basic module structure as you get started with Dagger.
@@ -13,4 +13,4 @@
1313
if appropriate. All modules should have a short description.
1414
"""
1515

16-
from .main import LocalstackDaggerModule as LocalstackDaggerModule
16+
from .main import Localstack as Localstack

.dagger/src/localstack_dagger_module/main.py renamed to .dagger/src/localstack/main.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99

1010

1111
@object_type
12-
class LocalstackDaggerModule:
12+
class Localstack:
1313
@function
1414
def start(
1515
self,

.dagger/uv.lock

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dagger.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
2-
"name": "localstack-dagger-module",
2+
"name": "localstack",
33
"engineVersion": "v0.18.2",
44
"sdk": {
55
"source": "python"

examples/python/dagger.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
},
77
"dependencies": [
88
{
9-
"name": "localstack-dagger-module",
9+
"name": "localstack",
1010
"source": "../.."
1111
}
1212
]

examples/python/src/example/main.py

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,9 @@
66
@object_type
77
class Example:
88
@function
9-
async def localstack_dagger_module__quickstart(self) -> str:
9+
async def localstack__quickstart(self) -> str:
1010
"""Example showing how to start LocalStack Community edition."""
11-
service = dag.localstack_dagger_module().start()
11+
service = dag.localstack().start()
1212

1313
await service.start()
1414
endpoint = await service.endpoint()
@@ -40,10 +40,10 @@ async def localstack_dagger_module__quickstart(self) -> str:
4040
print(f"S3 object content: {content}")
4141

4242
@function
43-
async def localstack_dagger_module__pro(self, auth_token: dagger.Secret) -> str:
43+
async def localstack__pro(self, auth_token: dagger.Secret) -> str:
4444
"""Example showing how to start LocalStack Pro with custom configuration."""
4545
# Start LocalStack Pro using the module
46-
service = dag.localstack_dagger_module().start(
46+
service = dag.localstack().start(
4747
auth_token=auth_token,
4848
configuration="DEBUG=1,SERVICES=ecr"
4949
)
@@ -66,9 +66,9 @@ async def localstack_dagger_module__pro(self, auth_token: dagger.Secret) -> str:
6666
print(f"ECR repository '{repository_name}' created")
6767

6868
@function
69-
async def localstack_dagger_module__state(self, auth_token: dagger.Secret) -> str:
69+
async def localstack__state(self, auth_token: dagger.Secret) -> str:
7070
"""Example showing how to manage LocalStack state using Cloud Pods."""
71-
service = dag.localstack_dagger_module().start(auth_token=auth_token)
71+
service = dag.localstack().start(auth_token=auth_token)
7272
await service.start()
7373
endpoint = await service.endpoint()
7474

@@ -84,20 +84,20 @@ async def localstack_dagger_module__state(self, auth_token: dagger.Secret) -> st
8484
s3.create_bucket(Bucket='test-bucket')
8585

8686
# Save state to Cloud Pod
87-
await dag.localstack_dagger_module().state(
87+
await dag.localstack().state(
8888
auth_token=auth_token,
8989
save="test-dagger-example-pod",
9090
endpoint=f"http://{endpoint}"
9191
)
9292

9393
# Reset state
94-
await dag.localstack_dagger_module().state(
94+
await dag.localstack().state(
9595
reset=True,
9696
endpoint=f"http://{endpoint}"
9797
)
9898

9999
# Load state back
100-
await dag.localstack_dagger_module().state(
100+
await dag.localstack().state(
101101
auth_token=auth_token,
102102
load="test-dagger-example-pod",
103103
endpoint=f"http://{endpoint}"
@@ -108,11 +108,11 @@ async def localstack_dagger_module__state(self, auth_token: dagger.Secret) -> st
108108
return f"Error: {str(e)}"
109109

110110
@function
111-
async def localstack_dagger_module_ephemeral(self, auth_token: dagger.Secret) -> str:
111+
async def localstack_ephemeral(self, auth_token: dagger.Secret) -> str:
112112
"""Example showing how to manage LocalStack Ephemeral Instances."""
113113
try:
114114
# Create a new ephemeral instance
115-
await dag.localstack_dagger_module().ephemeral(
115+
await dag.localstack().ephemeral(
116116
auth_token=auth_token,
117117
operation="create",
118118
name="test-dagger-example-instance",
@@ -125,15 +125,15 @@ async def localstack_dagger_module_ephemeral(self, auth_token: dagger.Secret) ->
125125
print("Instance created")
126126

127127
# List instances
128-
list_response = await dag.localstack_dagger_module().ephemeral(
128+
list_response = await dag.localstack().ephemeral(
129129
auth_token=auth_token,
130130
operation="list"
131131
)
132132

133133
print(f"Ephemeral instances: {list_response}")
134134

135135
# Get instance logs
136-
instance_logs = await dag.localstack_dagger_module().ephemeral(
136+
instance_logs = await dag.localstack().ephemeral(
137137
auth_token=auth_token,
138138
operation="logs",
139139
name="test-dagger-example-instance"
@@ -142,7 +142,7 @@ async def localstack_dagger_module_ephemeral(self, auth_token: dagger.Secret) ->
142142
print(f"Instance logs: {instance_logs}")
143143

144144
# Delete instance
145-
await dag.localstack_dagger_module().ephemeral(
145+
await dag.localstack().ephemeral(
146146
auth_token=auth_token,
147147
operation="delete",
148148
name="test-dagger-example-instance"

examples/typescript/dagger.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
},
77
"dependencies": [
88
{
9-
"name": "localstack-dagger-module",
9+
"name": "localstack",
1010
"source": "../.."
1111
}
1212
]

examples/typescript/src/index.ts

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -16,10 +16,10 @@ export class Example {
1616
* @returns Promise<void>
1717
*/
1818
@func()
19-
async localstack_dagger_module__quickstart() {
19+
async localstack__quickstart() {
2020
await connect(async (client) => {
2121
// Start LocalStack using the module
22-
const service = client.localstackDaggerModule().start()
22+
const service = client.localstack().start()
2323

2424
await service.start()
2525
const endpoint = await service.endpoint()
@@ -69,9 +69,9 @@ export class Example {
6969
* @returns Promise<void>
7070
*/
7171
@func()
72-
async localstack_dagger_module__pro(authToken: Secret) {
72+
async localstack__pro(authToken: Secret) {
7373
await connect(async (client) => {
74-
const service = client.localstackDaggerModule().start({
74+
const service = client.localstack().start({
7575
authToken,
7676
configuration: "DEBUG=1,SERVICES=ecr",
7777
})
@@ -107,9 +107,9 @@ export class Example {
107107
* @returns Promise<void>
108108
*/
109109
@func()
110-
async localstack_dagger_module__state(authToken: Secret) {
110+
async localstack__state(authToken: Secret) {
111111
await connect(async (client) => {
112-
const service = client.localstackDaggerModule().start({
112+
const service = client.localstack().start({
113113
authToken
114114
})
115115

@@ -133,7 +133,7 @@ export class Example {
133133
console.log("Test bucket created")
134134

135135
// Save state to Cloud Pod
136-
await client.localstackDaggerModule().state({
136+
await client.localstack().state({
137137
authToken,
138138
save: "test-dagger-example-pod",
139139
endpoint: `http://${endpoint}`
@@ -142,14 +142,14 @@ export class Example {
142142
console.log("State saved to Cloud Pod")
143143

144144
// Reset state
145-
await client.localstackDaggerModule().state({
145+
await client.localstack().state({
146146
reset: true,
147147
endpoint: `http://${endpoint}`
148148
})
149149
console.log("State reset")
150150

151151
// Load state back
152-
await client.localstackDaggerModule().state({
152+
await client.localstack().state({
153153
authToken,
154154
load: "test-dagger-example-pod",
155155
endpoint: `http://${endpoint}`
@@ -168,10 +168,10 @@ export class Example {
168168
* @returns Promise<void>
169169
*/
170170
@func()
171-
async localstack_dagger_module__ephemeral(authToken: Secret) {
171+
async localstack__ephemeral(authToken: Secret) {
172172
await connect(async (client) => {
173173
// Create a new ephemeral instance
174-
await client.localstackDaggerModule().ephemeral(
174+
await client.localstack().ephemeral(
175175
authToken,
176176
"create",
177177
{
@@ -185,14 +185,14 @@ export class Example {
185185
await new Promise(resolve => setTimeout(resolve, 15000))
186186

187187
// List instances
188-
const listResponse = await client.localstackDaggerModule().ephemeral(
188+
const listResponse = await client.localstack().ephemeral(
189189
authToken,
190190
"list"
191191
)
192192
console.log(`Ephemeral instances: ${listResponse}`)
193193

194194
// Get instance logs
195-
const instanceLogs = await client.localstackDaggerModule().ephemeral(
195+
const instanceLogs = await client.localstack().ephemeral(
196196
authToken,
197197
"logs",
198198
{
@@ -202,7 +202,7 @@ export class Example {
202202
console.log(`Instance logs: ${instanceLogs}`)
203203

204204
// Delete instance
205-
await client.localstackDaggerModule().ephemeral(
205+
await client.localstack().ephemeral(
206206
authToken,
207207
"delete",
208208
{

0 commit comments

Comments
 (0)