Coder Social home page Coder Social logo

util's Introduction

Livesport TV Utils

Go Reference Latest release License: MIT tests Go Report Card codecov

Open source implementation of Livesport TV utilities library.

Packages provide Formatter and Parser variables to override default behavior of format methods (MarshalText, MarshalJSON, String, ...) and parse methods (UnmarshalText, UnmarshalJSON, ...). Default value of Formatter is DefaultFormatter and default value of Parser is DefaultParser. Also, specific verbs for fmt formatting are available.

Date

import "go.lstv.dev/util/date"
  • Type Date represents date (year, month, day).
  • Function New to create new date.
  • Function DateFromTime to create date from time.Time.
  • Type DateFilter to work with date intervals and filtering.

Roman

import "go.lstv.dev/util/roman"
  • Type Number represents roman number.
  • It supports roman numerals:
    • M (1000)
    • D (500)
    • C (100)
    • L (50)
    • X (10)
    • V (5)
    • I (1)
  • Short and long forms are also supported and configurable.

Sem

import "go.lstv.dev/util/sem"
  • Type Version represents semantic version.
  • Functions:
    • Compare, CompareVersion and CompareTag
    • Latest, LatestVersion and LatestTag
    • Parse, ParseVersion and ParseTag
  • See Semantic Versioning 2.0.0 for more details.

Size

import "go.lstv.dev/util/size"
  • Provides type Size to keep, marshal and unmarshal times-byte size values.
  • It supports three JSON forms:
    • numeric form (JSON number is always in bytes)
    • string form (JSON string with or without units)
    • object form (JSON object like {"value":1000,"unit":"MiB"})

Test

import "go.lstv.dev/util/test"
  • Provides functions to test marshal and unmarshal methods:
    • MarshalBinary and UnmarshalBinary
    • MarshalText and UnmarshalText
    • MarshalJSON and UnmarshalJSON
  • See examples.

UUID

import "go.lstv.dev/util/uu"
  • Provides type ID to keep, marshal and unmarshal UUID values.

util's People

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.