Git Product home page Git Product logo

blueprint-5's Introduction

blueprint

Blueprint takes a template and turns it into source code. And more!

Usage

To start a project use the init command. It requires a couple of arguments, such as the template and the new name of the service.

blueprint init [service name] [name]

Blueprint will prompt for these, but it is possible to provide these through flags.

Building

We use dep to ensure all dependencies with their expected versions are present in the vendor directory.

dep ensure
go generate ./...
dep ensure
go install

iGenerator

We use igenerator to generate trace and metrics stores for certain templates. See cmd/igenerator/README.md for more information regarding generating stores and deploying the related Docker image.

Templates

Creating new templates

To create a new template in the templates folder. The files in there will be expanded using using normal go templates. However we use a couple of sentinels to make it easier to work with the templates:

"blueprint/templates/service" => "{{lower .Name}}"},
"Blueprint" => "{{title .Name}}"},
"blueprint" => "{{lower .Name}}"},
"blue_print" => "{{packaging .Name}}"},
"6666" => "{{.Port}}"},
"6667" => "{{.GatewayPort}}"},
"6668" => "{{.HealthPort}}"},
"6669" => "{{.MetricsPort}}"},
"TiVo for VRML" => "{{.Description}}"},
"1996" => "{{.Year}}"},
}

Of note is blue_print, which must be used for things that are package names.

Blueprint will also replace names in the directory names and filenames.

Future features

The following is a list of features that we want to create, but they currently do not exist yet.

  • Allow remote templates from Github or tarball's.
  • Allow templates to specify their own parameters, sentinel, etc.
  • Allow files to be ignored and/or sentinels in specific places to be ignored.
  • Go format all .go files.

License

Copyright (c) 2017-2018 Oracle and/or its affiliates. All rights reserved.

This program is free software: you can modify it and/or redistribute it under the terms of:

(i) the Universal Permissive License v 1.0 or at your option, any later version (http://oss.oracle.com/licenses/upl); and/or

(ii) the Apache License v 2.0. (http://www.apache.org/licenses/LICENSE-2.0)

blueprint-5's People

Contributors

faiq avatar flenter avatar gilbode avatar gsserge avatar hatchan avatar jwells131313 avatar kokaz avatar mrolla avatar reclaro avatar termie 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.