All Projects → palantir → amalgomate

palantir / amalgomate

Licence: Apache-2.0 license
Go tool for combining multiple different main packages into a single program or library

Programming Languages

go
31211 projects - #10 most used programming language
shell
77523 projects

Projects that are alternatives of or similar to amalgomate

go-baseapp
A lightweight starting point for Go web servers
Stars: ✭ 61 (+221.05%)
Mutual labels:  octo-correct-managed
go-license
Go tool that applies and verifies that proper license headers are applied to Go files
Stars: ✭ 42 (+121.05%)
Mutual labels:  octo-correct-managed
Plottable
📊 A library of modular chart components built on D3
Stars: ✭ 2,834 (+14815.79%)
Mutual labels:  octo-correct-managed
goastwriter
Go library for writing Go source code programatically
Stars: ✭ 27 (+42.11%)
Mutual labels:  octo-correct-managed
tracing-java
Java library providing zipkin-like tracing functionality
Stars: ✭ 13 (-31.58%)
Mutual labels:  octo-correct-managed
dialogue
A client-side RPC library for conjure-java
Stars: ✭ 12 (-36.84%)
Mutual labels:  octo-correct-managed
giraffe
Gracefully Integrated Remote Access For Files and Execution
Stars: ✭ 50 (+163.16%)
Mutual labels:  octo-correct-managed
Python Language Server
An implementation of the Language Server Protocol for Python
Stars: ✭ 2,412 (+12594.74%)
Mutual labels:  octo-correct-managed
bouncer
An application to cycle (bounce) all nodes in a coordinated fashion in an AWS ASG or set of related ASGs
Stars: ✭ 123 (+547.37%)
Mutual labels:  octo-correct-managed
gradle-docker-test-runner
Gradle plugin for running tests in Docker environments
Stars: ✭ 20 (+5.26%)
Mutual labels:  octo-correct-managed
python-jsonrpc-server
A Python 2 and 3 asynchronous JSON RPC server
Stars: ✭ 73 (+284.21%)
Mutual labels:  octo-correct-managed
dropwizard-web-logger
WebLoggerBundle is a Dropwizard bundle used to help log web activity to log files on a server’s backend
Stars: ✭ 14 (-26.32%)
Mutual labels:  octo-correct-managed
log4j-sniffer
A tool that scans archives to check for vulnerable log4j versions
Stars: ✭ 180 (+847.37%)
Mutual labels:  octo-correct-managed
hadoop-crypto
Library for per-file client-side encyption in Hadoop FileSystems such as HDFS or S3.
Stars: ✭ 38 (+100%)
Mutual labels:  octo-correct-managed
Blueprint
A React-based UI toolkit for the web
Stars: ✭ 18,376 (+96615.79%)
Mutual labels:  octo-correct-managed
witchcraft-go-server
A highly opinionated Go embedded application server for RESTy APIs
Stars: ✭ 47 (+147.37%)
Mutual labels:  octo-correct-managed
gradle-npm-run-plugin
No description or website provided.
Stars: ✭ 19 (+0%)
Mutual labels:  octo-correct-managed
rust-zipkin
A library for logging and propagating Zipkin trace information in Rust
Stars: ✭ 50 (+163.16%)
Mutual labels:  octo-correct-managed
Tslint
🚦 An extensible linter for the TypeScript language
Stars: ✭ 5,922 (+31068.42%)
Mutual labels:  octo-correct-managed
dropwizard-web-security
A Dropwizard bundle for applying default web security functionality
Stars: ✭ 37 (+94.74%)
Mutual labels:  octo-correct-managed

Autorelease

amalgomate

amalgomate combines multiple different Go projects with main packages into a single Go program or library.

amalgomate is useful in situations where one may want to vendor and use the functionality of multiple Go main packages that don't provide libraries for accessing their functionality. Because amalgomate programmatically rewrites the packages and provides an invocation mechanism for them, it provides a maintainable solution for using functionality provided by such main packages without having to manually fork or rewrite the libraries.

amalgomate takes a configuration file that specifies the main packages that should be combined and an output directory as arguments. It then does the following:

  • Creates a directory named internal in the output directory
    • This directory acts as a de facto vendoring directory with rewritten imports
  • Copies the projects for the specified inputs into the amaglomated directory
    • By default, it is assumed that the main package is the project root
    • If this is not the case, the configuration can be used to specify the degrees of separation between the main package and the root of the project package
  • Rewrites all of the imports of the copied projects to point to the copied version in amalgomated
  • All files that have a package value of main are renamed to amalgomated
    • Only the package name in the Go file is changed (the name of the directory containing the file will not be changed)
    • The main function is renamed to AmalgomatedMain
  • Writes a new Go file {{package_name}}.go in the output directory
    • If the specified package name is main, the Go file that is written contains a main function that provides a way to invoke the amalgomated commands by name
    • If the specified package name is not main, a library Go file is written. The library file contains a Run method that allows the wrapped program to be invoked by name and a Commands method that returns the valid commands

Usage

Install the package:

go get github.com/palantir/amalgomate

Run the command:

amalgomate --config repackage.yml --output-dir outpkg --pkg main

The above command runs amalgomate on the files specified in repackage.yml and writes the output source files into a new directory called outpkg. outpkg will contain an amalgomated directory that contains all of the repacked projects and a main.go file that contains a main method for invoking the repacked libraries.

Configuration

amalgomate uses a configuration file to determine the packages that should be used as input and the name of the command that should be used for that package. The configuration is a yml file that contains an entry for each program that should be repackaged:

packages:
  sample:
    main: github.com/nmiyake/go-sample
  inner:
    main: github.com/nmiyake/go-project/main
    distance-to-project-pkg: 1

Each package must have a unique name (this will be the value that the generated Go wrapper will use to reference the program). The package must specify a main package. The package will be resolved in the same way it would if it were in a Go source file contained in the output directory (including vendoring behavior). If the program being wrapped is in a subdirectory of a main project, then the distance-to-project-pkg parameter can be used to specify the distance between the main package and the project root package. When a program is being wrapped, the project package is copied into the vendor directory of the output directory, so this parameter can be used in cases where the main package is in a subdirectory of a project but more files need to be copied in order for the import to function correctly.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].