Giter Site home page Giter Site logo

go.stripe's Introduction

Gitness

Gitness is an open source development platform packed with the power of code hosting and automated DevOps pipelines.

Overview

Gitness is an open source development platform packed with the power of code hosting and automated continuous integration pipelines.

Running Gitness locally

The latest publicly released docker image can be found on harness/gitness.

To install Gitness yourself, simply run the command below. Once the container is up, you can visit http://localhost:3000 in your browser.

docker run -d \
  -p 3000:3000 \
  -v /var/run/docker.sock:/var/run/docker.sock \
  -v /tmp/gitness:/data \
  --name gitness \
  --restart always \
  harness/gitness

The Gitness image uses a volume to store the database and repositories. It is highly recommended to use a bind mount or named volume as otherwise all data will be lost once the container is stopped.

See docs.gitness.com to learn how to get the most out of Gitness.

Where is Drone?

Gitness represents a massive investment in the next generation of Drone. Where Drone focused on continuous integration, Gitness adds source code hosting, bringing code management and pipelines closer together.

The goal is for Gitness to eventually be at full parity with Drone in terms of pipeline capabilities, allowing users to seemlessly migrate from Drone to Gitness.

But, we expect this to take some time, which is why we took a snapshot of Drone as a feature branch drone (README) so it can continue development.

As for Gitness, the development is taking place on the main branch.

For more information on Gitness, please visit gitness.com.

For more information on Drone, please visit drone.io.

Gitness Development

Pre-Requisites

Install the latest stable version of Node and Go version 1.20 or higher, and then install the below Go programs. Ensure the GOPATH bin directory is added to your PATH.

Install protobuf

  • Check if you've already installed protobuf protoc --version
  • If your version is different than v3.21.11, run brew unlink protobuf
  • Get v3.21.11 curl -s https://raw.githubusercontent.com/Homebrew/homebrew-core/9de8de7a533609ebfded833480c1f7c05a3448cb/Formula/protobuf.rb > /tmp/protobuf.rb
  • Install it brew install /tmp/protobuf.rb
  • Check out your version protoc --version

Install protoc-gen-go and protoc-gen-go-rpc:

  • Install protoc-gen-go v1.28.1 go install google.golang.org/protobuf/cmd/[email protected] (Note that this will install a binary in $GOBIN so make sure $GOBIN is in your $PATH)

  • Install protoc-gen-go-grpc v1.2.0 go install google.golang.org/grpc/cmd/[email protected]

$ make dep
$ make tools

Build

First step is to build the user interface artifacts:

$ pushd web
$ yarn install
$ yarn build
$ popd

After that, you can build the gitness binary:

$ make build

Run

This project supports all operating systems and architectures supported by Go. This means you can build and run the system on your machine; docker containers are not required for local development and testing.

To start the server at localhost:3000, simply run the following command:

./gitness server .local.env

Auto-Generate Gitness API Client used by UI using Swagger

Please make sure to update the autogenerated client code used by the UI when adding new rest APIs.

To regenerate the code, please execute the following steps:

  • Regenerate swagger with latest gitness binary ./gitness swagger > web/src/services/code/swagger.yaml
  • navigate to the web folder and run yarn services

The latest API changes should now be reflected in web/src/services/code/index.tsx

User Interface

This project includes a full user interface for interacting with the system. When you run the application, you can access the user interface by navigating to http://localhost:3000 in your browser.

REST API

This project includes a swagger specification. When you run the application, you can access the swagger specification by navigating to http://localhost:3000/swagger in your browser (for raw yaml see http://localhost:3000/openapi.yaml).

For testing, it's simplest to just use the cli to create a token (this requires gitness server to run):

# LOGIN (user: admin, pw: changeit)
$ ./gitness login

# GENERATE PAT (1 YEAR VALIDITY)
$ ./gitness user pat "my-pat-uid" 2592000

The command outputs a valid PAT that has been granted full access as the user. The token can then be send as part of the Authorization header with Postman or curl:

$ curl http://localhost:3000/api/v1/user \
-H "Authorization: Bearer $TOKEN"

CLI

This project includes VERY basic command line tools for development and running the service. Please remember that you must start the server before you can execute commands.

For a full list of supported operations, please see

$ ./gitness --help

go.stripe's People

Contributors

ae0000 avatar avitex avatar boj avatar bradrydzewski avatar elithrar avatar freeeve avatar irwinb avatar purohit avatar tdburke avatar titanous avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

go.stripe's Issues

Cancel Subscription, At Period End

When cancelling a subscription need to enable the at_parameter_end flag:

If you set the at_parameter_end parameter to true, the subscription will remain active until the end of the period, at which point it will be cancelled and not renewed.

Create Customer using Card Token

Per the Stripe API docs, we should be able to substitute a Token in place of any API call that sends an actual Credit Card. Need to implement this functionality, specifically in the Customers.Create and Customer.Update API implementations

Status of the repo?

Hi there,

I'm just checking if the library is still being maintained, and if so, if we should use bradrydzewski's version or drone.io's version.

Thanks!

Two incorrect checks in plan_test.go

Two checks in plan_test.go compare a value with itself, instead of with the expected value:

/src/github.com/drone/go.stripe/plan_test.go:53:5: identical expressions on the left and right side of the '!=' operator
/src/github.com/drone/go.stripe/plan_test.go:98:5: identical expressions on the left and right side of the '!=' operator

No stripe.Cards?

In stripe.go there's a convenience constructor for most ...Client types, but there isn't one that says:

Cards = new(CardClient)

Any reason for that? I can submit a pull request fix if not.

Implement HandlerFunc for Events

Implement an http.HandlerFunc so that a developer can easily handle Stripe Events.

i'm thinking something like this

type EventCallback func(Event);

func HandleEvent(callback EventCallback) {
    return func(req *http.Request, resp http.Response) {
         // parse the event in the incoming request
         event, err := json.Unmarshall(...)

         // return a 202 so that stripe knows we go it
         w.WriteHeader(http.StatusOK)

         // invoke EventCallback function
         go callback(event)
    }
}

Delete return types

Delete functions should return a special struct, that use the following format:

{
  "deleted": true,
  "id": "cus_3Sndou3HZmZVOW"
}

Update Subscription, Attach New Card

When updating a subscription, the API gives the ability to attach a new Credit Card (or Card Token). This feature is currently not implemented.

Missing "data" field for Invoice.Data.Object.Lines type ?

Hi,

I think i spotted an error while using the webhooks. It returns an object which contains "lines". But it contains json field called "data" which is not present in the structure :(

Can you confirm it ?

JSON
Webhook payment_succeeded from stripe

  "period_start": 1406634003,
      "period_end": 1406634003,
      "lines": {
        "data": [       // <==== HERE
          {
            "id": "sub_4UY3vxOFvXGlQm",
            "object": "line_item",
            "type": "subscription",

Struct
https://github.com/drone/go.stripe/blob/master/invoice.go

....
    Discount        *Discount     `json:"discount"`
    Lines           *InvoiceLines `json:"lines"`
    StartingBalance int64         `json:"starting_balance"`
    EndingBalance   Int64         `json:"ending_balance"`
    NextPayment     Int64         `json:"next_payment_attempt"`
    Livemode        bool          `json:"livemode"`
}

// InvoiceLines represents an individual line items that is part of an invoice.
type InvoiceLines struct {
    InvoiceItems  []*InvoiceItem      `json:"invoiceitems"`
    Prorations    []*InvoiceItem      `json:"prorations"`
    Subscriptions []*SubscriptionItem `json:"subscriptions"`
}

type SubscriptionItem struct {
    Amount int64   `json:"amount"`
    Period *Period `json:"period"`
    Plan   *Plan   `json:"plan"`
}
....

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.