Giter VIP home page Giter VIP logo

pacman's Introduction

Pacman - Yet Another Toolkit to Build Golang Application Quickly

logo

LICENSE Language

Pacman is a Golang library that abstracts the common libraries and patterns used in Golang application development. It provides a set of standard interfaces and implementations that can be used to build a Golang application quickly.

Notice: This document also has Simplified Chinese 中文版本 Edition.

Why call it Pacman?

We inspired by two things:

  1. Pacman is the package manager of Arch Linux, which is a very popular Linux distribution. We want to make it easy to use third-party packages in Go projects, just like what pacman does in Arch Linux.
  2. Pacman is also a video game character, which is very popular in the 1980s. We want to make it easy to build a Golang application quickly, just like Pacman eats all the dots in the maze.

Changelog

20220919 initial release

Design Philosophy

Golang is very stable and robust for server-side application development. But some general issues are confusing and blocking the progress of development, such as:

  1. We need many third-party libraries to build the application. We need to choose a suitable one or multiple solutions at the same time, but do not want to be too dependent on them;
  2. The upgrade and replacement of third-party dependencies will cause failures, eg. some third-party libraries do not support major version updates.
  3. We're building microservices that may require common features, so we don't need to develop them repeatedly.

Based on above the issues, we began to think about how to manage third-party libraries. Far as we are aware of the Spring Boot which famous framework from Java world managing the third-party libraries or dependencies by Bean. This is the appropriate implementation for Ioc - The injection of dependencies.

Requirements and install

This project requires golang v1.18 or higher version with new features such as general generic and so on.

How to Use It

To use this toolkit is very simple and easy. For example, we wanna including the general cache module which has implemented:

First, we import the interface from the definition of the cache module.

import "github.com/segmentfault/pacman/cache/v2"

Second, we import the implementation from the other path.

import "github.com/segmentfault/pacman/contrib/cache/v2"

Finally, we use it!

cache := v2.NewCache[int, string]()
cache.Set(1, "hello")

got, ok := cache.Get(1)
assert.Equal(t, ok, true)
assert.Equal(t, got, "hello")

The cache module should be running correctly.

Contributing

Contributions are always welcome!

See contributing.md for ways to get started.

Please adhere to this project's code of conduct.

License

MIT

pacman's People

Contributors

aichy126 avatar joyqi avatar linkinstars avatar mingcheng 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.