GithubHelp home page GithubHelp logo

isabella232 / platform-lib Goto Github PK

View Code? Open in Web Editor NEW

This project forked from rstudio/platform-lib

0.0 0.0 0.0 728 KB

Shared Go Libraries

License: MIT License

Shell 1.57% Python 0.69% Go 96.60% Dockerfile 1.14%

platform-lib's Introduction

RStudio Platform Go Libraries

Overview

This repo includes useful Go code for building applications.

Graph

Dependency Graph

Go Directories

/internal

Private application and library code. This is for code we don't want others importing in their applications or libraries. Note that this layout pattern is enforced by the Go compiler itself. See the Go 1.4 release notes for more details. Note that you are not limited to the top level internal directory. You can have more than one internal directory at any level of your project tree.

You can optionally add a bit of extra structure to your internal packages to separate your shared and non-shared internal code. It's not required (especially for smaller projects), but it's nice to have visual clues showing the intended package use. Your actual application code can go in the /internal/app directory (e.g., /internal/app/myapp) and the code shared by those apps in the /internal/pkg directory (e.g., /internal/pkg/myprivlib).

/pkg

Shared library code for use by external applications (e.g., /pkg/rslog). Other projects can import these libraries expecting them to work.

/examples

Example applications that demonstrate using the shared libraries.

Common Application Directories

/scripts

Scripts to perform various build, install, linting, and documentation tasks.

These scripts keep the root level justfile small and simple (e.g., https://github.com/hashicorp/terraform/blob/master/Makefile).

/test

End-to-end tests. These tests are performed in CI by GitHub Actions.

Other Directories

/docs

Design and user documents (in addition to your godoc generated documentation).

Tooling

We use just to run project specific commands. See the GitHub repository for installation and examples.

You will also need Docker if you wish to run the integration tests.

Testing

We test multiple modules by default. Therefore, if you wish to test a specific package, you must specify the MODULE env variable. See the examples below.

Examples:

# Run all Go tests
just test

# Run all Go tests twice
just test -count 2 ./...

# Run all tests once (no cached results)
just test -count 1 ./...

# Run with verbose output
just test -v ./...

# Run the "TestNewDebugLog" test twice with verbose output
MODULE=pkg/rslog just test -v -count 2 github.com/rstudio/platform-lib/pkg/rslog/debug -testify.m=TestNewDebugLog

# Run the LocalNotifySuite suite tests with verbose output
MODULE=pkg/rsnotify just test -v github.com/rstudio/platform-lib/pkg/rsnotify/locallistener -check.f=LocalNotifySuite

# Run the PgxNotifySuite suite tests with docker-compose
MODULE=pkg/rsnotify just test-integration -v github.com/rstudio/platform-lib/pkg/rsnotify/pgxlistener -check.f=PgxNotifySuite

# Run the end-to-end tests
just build
just test-e2e

# Open an interactive container for end-to-end testing
just start-e2e-env
just test
exit

Licenses

To update NOTICE.md with a list of licenses from third-party Go modules, use the just licenses target. This requires Python 3.

Versioning

Follow semantic versioning guidelines. To release a new version, we simply create and push a tag.

git tag v0.1.2
git push origin v0.1.2

To enumerate the latest version tag for each module, run:

just versions

Badges

  • Go Report Card - It will scan your code with gofmt, go vet, gocyclo, golint, ineffassign, license and misspell. Replace github.com/golang-standards/project-layout with your project reference.

    Go Report Card

  • Pkg.go.dev - Pkg.go.dev is a new destination for Go discovery & docs. You can create a badge using the badge generation tool.

    PkgGoDev

  • Release - It will show the latest release number for your project. Change the github link to point to your project.

    Release

platform-lib's People

Contributors

jonyoder avatar eduardocfalcao avatar marcosnav avatar tylfin avatar zackverham avatar mcbex avatar dethmasque avatar nodivbyzero 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.