diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml deleted file mode 100644 index 3b1391a..0000000 --- a/.gitlab-ci.yml +++ /dev/null @@ -1,28 +0,0 @@ -image: autogen-docker-local.artifactory.eng.vmware.com/autogen-builder:1.7 - -services: - - name: eve-docker-local.artifactory.eng.vmware.com/docker:18-dind - alias: docker - -stages: - - build - - test - -before_script: - - go get ./... - - go get github.com/stretchr/testify/assert - -build-app: - stage: build - variables: - DOCKER_HOST: tcp://docker:2375 - DOCKER_DRIVER: overlay2 - script: - - ./build-transport.sh -a amd64 -o linux - - -test-app: - stage: test - script: - - go test ./... - - go test -cover -v ./... diff --git a/CODE-OF-CONDUCT.md b/CODE-OF-CONDUCT.md index 4be21df..4d035a7 100644 --- a/CODE-OF-CONDUCT.md +++ b/CODE-OF-CONDUCT.md @@ -2,7 +2,7 @@ ## Our Pledge -We as members, contributors, and leaders pledge to make participation in Transport Go and our +We as members, contributors, and leaders pledge to make participation in transport-go and our community a harassment-free experience for everyone, regardless of age, body size, visible or invisible disability, ethnicity, sex characteristics, gender identity and expression, level of experience, education, socio-economic status, diff --git a/README.md b/README.md index 59ce7b2..26719c8 100644 --- a/README.md +++ b/README.md @@ -1,13 +1,27 @@ -# Transport for Go +# Transport - Golang -badges to be added in. +Transport is a full stack, simple, fast, expandable application event bus for your applications. -## Using the Transport +### What does that mean? + +Transport is an event bus, that allows application developers to build components that can talk to one another, really easily. + +It provides a standardized and simple API, implemented in multiple languages, to allow any individual component inside your applications to talk to one another. + +It really comes to life when you use it to send messages, requests, responses and events around your backend and front-end. Your Java or Golang backend can stream messages to your UI components, as if they were sitting right next to each other. + +Channels can be extended to major brokers like Kafka or RabbitMQ, so Transport becomes an 'on/off-ramp' for your main sources of truth. + +### [View Transport Golang Documentation](https://vmware.github.io/transport/golang) + +#### [Transport Docs Repo](https://github.com/vmware/transport) + +## Quick Start To create an instance of the bus ```go -bf := bus.GetBus() +var transport EventBus = bus.GetBus() ``` The API is pretty simple. @@ -76,9 +90,9 @@ A simple ping pong looks a little like this. ```go // listen for a single request on 'some-channel' -bf := bus.GetBus() +tr := bus.GetBus() channel := "some-channel" -bf.GetChannelManager().CreateChannel(channel) +tr.GetChannelManager().CreateChannel(channel) // listen for a single request on 'some-channel' requestHandler, _ := bf.ListenRequestStream(channel) @@ -88,14 +102,14 @@ requestHandler.Handle( fmt.Printf("\nPing: %s\n", pingContent) // send a response back. - bf.SendResponseMessage(channel, pingContent, msg.DestinationId) + tr.SendResponseMessage(channel, pingContent, msg.DestinationId) }, func(err error) { // something went wrong... }) // send a request to 'some-channel' and handle a single response -responseHandler, _ := bf.RequestOnce(channel, "Woo!") +responseHandler, _ := tr.RequestOnce(channel, "Woo!") responseHandler.Handle( func(msg *model.Message) { fmt.Printf("Pong: %s\n", msg.Payload.(string)) @@ -207,3 +221,37 @@ func usingGalacticChannels() { } } ``` + +### [Read More Golang Documentation](https://vmware.github.io/transport/golang) + +## Contributing + +The transport-typescript project team welcomes contributions from the community. Before you start working with transport-typescript, please +read our [Developer Certificate of Origin](https://cla.vmware.com/dco). All contributions to this repository must be +signed as described on that page. Your signature certifies that you wrote the patch or have the right to pass it on +as an open-source patch. For more detailed information, refer to [CONTRIBUTING.md](CONTRIBUTING.md). + +## License +BSD-2-Clause + +Copyright (c) 2016-2021, VMware, Inc. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + +1. Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. +2. Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND +ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR +ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND +ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/build-transport.sh b/build-transport.sh index a69b044..425f5e0 100755 --- a/build-transport.sh +++ b/build-transport.sh @@ -2,14 +2,14 @@ # Copyright 2019-2020 VMware, Inc. # SPDX-License-Identifier: BSD-2-Clause # -# This script will build the binary sample application for transport, requires docker. +# This script will build the binary sample application for transport # COLOR_RESET="\033[0m" COLOR_RED="\033[38;5;9m" COLOR_LIGHTCYAN="\033[1;36m" COLOR_LIGHTGREEN="\033[1;32m" -COMMANDS=(transport) +COMMANDS=(transport-go) OUT_DIR=${OUT_DIR:-./} BUILD_TIME=`date | sed -e 's/ /_/g'` TARGET_OS=${TARGET_OS:-darwin} @@ -40,17 +40,6 @@ _trap() { exit 1 } -check_prerequisites() { - if [ "${LOCAL_BUILD}" = "1" ] ; then - # we're inside the transport container. no need to check docker daemon - return - fi - docker ps >/dev/null 2>&1 - if [ $? -gt 0 ] ; then - error "Docker failed to respond! Please check if Docker Engine is running" - fi -} - build() { local CMD=$1 info "Building ${CMD} for ${TARGET_OS} ${TARGET_ARCH}..." @@ -93,7 +82,6 @@ done # ensure output dir exist mkdir -p ${OUT_DIR} -check_prerequisites for CMD in ${COMMANDS[@]} ; do GOOS=${TARGET_OS} GOARCH=${TARGET_ARCH} build $CMD done