📰 IT Security NachrichtenHuawei Shows Next-Generation Data Centre Optics Amid Standards Push(14.09.2026 um 09:01 Uhr)
📰 IT Security NachrichtenRobot Start-Up Skild AI Hits $100m Revenue Run-Rate(14.09.2026 um 09:31 Uhr)
📰 IT Security NachrichtenA week in security (September 7 – September 13)(14.09.2026 um 09:31 Uhr)
📰 IT Security NachrichtenIT Security News Hourly Summary 2026-09-14 10h : 8 posts(14.09.2026 um 10:00 Uhr)
📰 IT Security NachrichtenHackers Abuse AutoIt to Inject AsyncRAT Into Microsoft-Signed Windows Process(14.09.2026 um 10:02 Uhr)
📰 IT Security NachrichtenUK Military Spends Millions On SpaceX Satellite Services(14.09.2026 um 10:02 Uhr)
🔧 AI Nachrichten OpenAI, Claude and Other Chatbot Outages Reported(03.09.2026 um 20:00 Uhr)
📰 IT Security NachrichtenHuawei Shows Next-Generation Data Centre Optics Amid Standards Push(14.09.2026 um 09:01 Uhr)
📰 IT Security NachrichtenRobot Start-Up Skild AI Hits $100m Revenue Run-Rate(14.09.2026 um 09:31 Uhr)
📰 IT Security NachrichtenA week in security (September 7 – September 13)(14.09.2026 um 09:31 Uhr)
📰 IT Security NachrichtenIT Security News Hourly Summary 2026-09-14 10h : 8 posts(14.09.2026 um 10:00 Uhr)
📰 IT Security NachrichtenHackers Abuse AutoIt to Inject AsyncRAT Into Microsoft-Signed Windows Process(14.09.2026 um 10:02 Uhr)
📰 IT Security NachrichtenUK Military Spends Millions On SpaceX Satellite Services(14.09.2026 um 10:02 Uhr)
🔧 AI Nachrichten OpenAI, Claude and Other Chatbot Outages Reported(03.09.2026 um 20:00 Uhr)

🔧 Programmierung 🕛 vor 3 Jahren 4 Min Lesezeit
0

Go Cloud Development Kit

↗ Quelle (dev.to)
🗣️ Stimme:

In this post, I will talk about an exciting project maintained by the team that develops the Go language: the storage in the tests, while in the production environment, we can use the cloud provider.


  • Different environments. We can use a cheaper supplier in a test/homologation environment and one more robust and expensive in the production environment.


  • Evolution. Your application may start with a more straightforward solution, say .

  • For example, let's look at the following code:




    CODE
    package main

    import (
    "context"
    "fmt"

    "gocloud.dev/blob"
    "gocloud.dev/blob/memblob"
    )

    func main() {
    ctx := context.Background()
    // Create an in-memory bucket.
    bucket := memblob.OpenBucket(nil)
    defer bucket.Close()

    key := "my-key"
    text := []byte("hello world")

    // Now we can use bucket to read or write files to the bucket.
    err := write(ctx, bucket, key, text)
    if err != nil {
    panic(err)
    }
    data, err := read(ctx, bucket, key)
    if err != nil {
    panic(err)
    }
    fmt.Println(string(data))
    }

    func write(ctx context.Context, bucket *blob.Bucket, key string, text []byte) error {
    err := bucket.WriteAll(ctx, key, text, nil)
    return err
    }

    func read(ctx context.Context, bucket *blob.Bucket, key string) ([]byte, error) {
    return bucket.ReadAll(ctx, key)
    }







    In the code, we are writing and reading from a document stored in a memory bucket. Therefore, to change the decision and use S3, it is only necessary to change the snippet below in the main function:




    CODE
    sess, err := session.NewSession(&aws.Config{
    Region: aws.String("us-west-1"),
    })

    sess, err = session.NewSessionWithOptions(session.Options{
    Profile: "profile_name_configured_in_your_machine",
    Config: aws.Config{
    Region: aws.String("us-east-1"),
    },
    })
    if err != nil {
    panic(err)
    }
    bucket, err := s3blob.OpenBucket(ctx, sess, "post-go-cdk", nil)
    if err != nil {
    panic(err)
    }
    defer bucket.Close()






    We are setting up the S3 connection and creating a bucket on this provider. The rest of the code doesn't change. We continue using the read and write functions.



    Currently, the project has abstractions for:




    • , i.e., document databases, with support for Google Cloud Firestore, Amazon DynamoDB, Azure Cosmos DB, MongoDB, and in-memory storage.


    • . Perhaps the most complete, with support for Google Cloud Pub/Sub, Amazon Simple Notification Service (SNS), Amazon Simple Queue Service (SQS), Azure Service Bus, RabbitMQ, NATS, Kafka and memory storage.

    • And the list goes on.

    And in addition to code, the official website has an area with some important on January 10, 2023.

    Vollständiger Original-Bericht
    Ausführliche Details, Code-Beispiele & Hersteller-Stellungnahme auf dev.to.
    ↗ Original-Artikel auf dev.to lesen
    Wie bewertest du diesen Beitrag?
    1 Klick Feedback
    Teilen mit Netzwerk & Team:

    Community-Analysen & Experten-Meinungen 0

    Verfasse deine eigene Analyse, teile Workarounds oder diskutiere diesen Vorfall im Blog.
    Noch keine Community-Analyse verfasst. Markiere einen Textabschnitt oder klicke oben auf Eigene Analyse verfassen“!
    Community Pulse: Relevanz-Einschätzung
    1 Klick Experten-Votum
    🔴 Akute Relevanz 0%
    🟡 In Evaluierung 0%
    🟢 Keine Auswirkung 0%
    Spannende Innovation 0%
    Verwandte Story-Cluster & Quellen (Vektor-KI)
    Port 8095 Engine
    4 Quellen
    CISA Adds Seven Exploited Flaws as Attackers Deploy Reverse Shells and Crypto Miners
    1 Quelle
    WordlistLoader Delivers Amatera via ClickFix, SynkLoader Phishes Windows Passwords
    1 Quelle
    ThreatsDay: 296K IoT Botnet, 100+ Water Systems Targeted, SharePoint RCE Chain + 27 New Stories
    Ähnliche Beiträge
    🔍 Verwandte News

    Auch interessante Nachrichten Go Cloud Development Kit

    Thematisch verwandte Begriffe: Cloud, Development · 6 Treffer

    Laden...

    Videos werden geladen ...

    Laden...

    Beiträge werden geladen ...

    Laden...

    Videos werden geladen ...

    Laden...

    Beiträge werden geladen ...

    Laden...

    Videos werden geladen ...