Giter VIP home page Giter VIP logo

kusanagi-sdk-go's Introduction

Go SDK for the KUSANAGI framework

Go Report Card License: MIT

Go SDK to interface with the KUSANAGI™ framework (http://kusanagi.io).

Requirements

Installation

Install the SDK using the following command:

$ go get github.com/kusanagi/kusanagi-sdk-go/v5@epoch-5

Getting Started

See the getting started tutorial to begin with the KUSANAGI™ framework and the Go SDK.

Cancellation Signal

The Go SDK implements support to signal deadlines or cancellation through a read only channel that is available to Middleware and Service components.

The channel can be read using the Api.Done() method. For example, within a service action:

func handler(action *kusanagi.Action) (*kusanagi.Action, error) {
    // Create a context for the current service call
    ctx, cancel := context.WithCancel(context.Background())

    // Create a channel to get the task result
    result := make(chan int)

    // Run some async task
    go task(ctx, result)

    // Cancel the context when the service call times out
    select{
    case v := <-result:
       action.Log(v, 6)
    case <-action.Done():
        cancel()
    }

    return action, nil
}

It is highly recommended to monitor this channel and stop any ongoing task when the channel is closed.

Documentation

See the API for a technical reference of the SDK.

For help using the framework see the documentation.

Support

Please first read our contribution guidelines.

We use milestones to track upcoming releases inline with our versioning strategy, and as defined in our roadmap.

Contributing

If you'd like to know how you can help and support our Open Source efforts see the many ways to get involved.

Please also be sure to review our community guidelines.

License

Copyright 2016-2023 KUSANAGI S.L. (http://kusanagi.io). All rights reserved.

KUSANAGI, the sword logo and the "K" logo are trademarks and/or registered trademarks of KUSANAGI S.L. All other trademarks are property of their respective owners.

Licensed under the MIT License. Redistributions of the source code included in this repository must retain the copyright notice found in each file.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.