Giter Site home page Giter Site logo

mpd.clj's Introduction

mpd-clj

An MPD client implementation in clojure

Declaring Dependency

[mpd-clj "0.2.0"]

Note: A breaking change in the API has occurred since 0.1.8. Please read the updated documentation below.

Basic Usage

You can pull in the entire library by requireing mpd-clj.core

(ns example.core
  (:require [mpd-clj.core :as mpd]))

;; create a client and pass it your host and port info.
(def mpd-server (mpd/client {:host "10.0.0.1" :port 6600}))

;; execute the stats command using the specified client
(mpd/stats mpd-server)

Or you can pull in individual pieces

(ns example.core
  (:require [mpd-clj.utils :as mpd]
            [mpd-clj.status :refer :all])

;; define the host and port of your mpd server
(def mpd-server (mpd/client {:host "10.0.0.1" :port 6600}))

;; execute the stats command on the specified server
(stats mpd-server)

The namespaces you can pull in are

All functions require a client object. In my usage I call it mpd-server but you can call it anything. The client function returns an object representing an asyncronous tcp connection. The client function requires a server configuration object. The server configuration is a map with two key value pairs, host and port. host expects a string of either an IP address or FQDN. port expects an integer.

Documentation

API docs

Todo

  • make library feature complete with mpd documentation
  • write more tests

License

Copyright © 2015 Tim Gallant

Distributed under the Eclipse Public License either version 1.0 or (at your option) any later version.

mpd.clj's People

Contributors

tgallant avatar crofty avatar

Watchers

 avatar James Cloos 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.