Code Monkey home page Code Monkey logo

osb-broker-lib's Introduction

osb-broker-lib

Build Status Go Report Card Godoc documentation

A go library for developing an Open Service Broker, using the pmorie/go-open-service-broker-client OSB client library types. This project was originally created as part of the OSB Starter Pack project.

Who should use this library?

This library is most useful if you want to build your own broker from scratch and use it in a project just the way you want. If you're looking for an opinionated quickstart to easily start iterating on a new broker you should instead check out the OSB Starter Pack.

Example: serving broker catalog

import (
    osb "github.com/pmorie/go-open-service-broker-client/v2"
    broker "github.com/pmorie/osb-broker-lib/pkg/"

    "gopkg.in/yaml.v2"
)

type MyBroker struct {
    // internal state goes here
}

func (b *MyBroker) GetCatalog(ctx *broker.RequestContext) (*osb.CatalogResponse, error) {
    response := &osb.CatalogResponse{}

    data := `
---
services:
- name: example-service
  id: 4f6e6cf6-ffdd-425f-a2c7-3c9258ad246e
  description: The example service!
  bindable: true
  metadata:
    displayName: "Example service"
    imageUrl: https://avatars2.githubusercontent.com/u/19862012?s=200&v=4
  plans:
  - name: default
    id: 86064792-7ea2-467b-af93-ac9694d96d5c
    description: The default plan for the service
    free: true
`

    err := yaml.Unmarshal([]byte(data), &response)
    if err != nil {
        return nil, err
    }

    return response, nil
}

Goals

  • Provide a simple, composable way to implement the OSB API

Current Status

Currently this library is used on the OSB Starter Pack project.

osb-broker-lib's People

Contributors

pmorie avatar lilic avatar shawn-hurley avatar mackwong avatar jmrodri avatar carolynvs avatar indradhanush avatar eriknelson avatar clamoriniere1a avatar

Watchers

James Cloos avatar

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.