`ctxio` gives `io.copy` operations the ability to cancel with context and retrieve progress data.

Related tags

ctxio
Overview

ctxio

The ctxio package gives golang io.copy operations the ability to terminate with context and retrieve progress data.

Install

  go get github.com/binalyze/ctxio

Usage

Here is an example to use ctxio with io.copy operation. You can find more examples in test files.

Writer

srcFile, err := os.Open("sourcefile.log")
dstFile, err := os.Create("destinationFile.log")

progressFn := func(n int64) {
    // Here you can send progress to API etc.
}

w := NewWriter(ctx, dstFile, progressFn)

written, err := io.Copy(w, file)

Roadmap

  • Add io.Reader support just like io.Writer

Related Projects

Issues
Owner
Binalyze
Incident Response re-imagined!
Binalyze
golang library for creating web application

RUI library The RUI (Remoute User Interface) library is designed to create web applications in the go language. The peculiarity of the library is that

Alexei Anoshenko 7 Sep 13, 2021
REST Layer, Go (golang) REST API framework

REST Layer REST APIs made easy. REST Layer is an API framework heavily inspired by the excellent Python Eve. It helps you create a comprehensive, cust

Olivier Poitrey 1.1k Sep 20, 2021
fn

fn This library aims to simplify the construction of JSON API service, fn.Wrap is able to wrap any function to adapt the interface of http.Handler, wh

PingCAP 27 May 23, 2021
lightweight, idiomatic and composable router for building Go HTTP services

chi is a lightweight, idiomatic and composable router for building Go HTTP services. It's especially good at helping you write large REST API services

go-chi 10.1k Sep 21, 2021
🍐 Elegant Golang REST API Framework

An Elegant Golang Web Framework Goyave is a progressive and accessible web application framework focused on REST APIs, aimed at making backend develop

Goyave 892 Sep 22, 2021
letgo is an open-source, high-performance web framework for the Go programming language.

high-performance Lightweight web framework for the Go programming language. golang web framework,高可用golang web框架,go语言 web框架 ,go web

wjp 171 Sep 18, 2021
Rocinante is a gin inspired web framework built on top of net/http.

Rocinante Rocinante is a gin inspired web framework built on top of net/http. ⚙️ Installation $ go get -u github.com/fskanokano/rocinante-go ⚡️ Quicks

null 3 Jul 27, 2021
⚡ Rux is an simple and fast web framework. support middleware, compatible http.Handler interface. 简单且快速的 Go web 框架,支持中间件,兼容 http.Handler 接口

Rux Simple and fast web framework for build golang HTTP applications. NOTICE: v1.3.x is not fully compatible with v1.2.x version Fast route match, sup

Gookit 68 Sep 10, 2021
A different approach to Go web frameworks

Note: gongular recently updated, and if you are looking for the previous version it is tagged as v.1.0 gongular is an HTTP Server Framework for develo

Mustafa Akın 442 Jun 22, 2021
Classy web framework for Go

Martini NOTE: The martini framework is no longer maintained. Martini is a powerful package for quickly writing modular web applications/services in Go

Martini 11.3k Sep 21, 2021
Yet Another REST Framework

YARF: Yet Another REST Framework YARF is a fast micro-framework designed to build REST APIs and web services in a fast and simple way. Designed after

null 62 Jun 30, 2021
A high level web-framework for Go

go-start is a high level web-framework for Go, like Django for Python or Rails for Ruby. Installation: go get github.com/ungerik/go-start Documentatio

Erik Unger 265 Jun 22, 2021
gin auto binding,grpc, and annotated route,gin 注解路由, grpc,自动参数绑定工具

中文文档 Automatic parameter binding base on go-gin doc Golang gin automatic parameter binding Support for RPC automatic mapping Support object registrati

xxj 190 Sep 23, 2021
Go web framework with a natural feel

Fireball Overview Fireball is a package for Go web applications. The primary goal of this package is to make routing, response writing, and error hand

Zack Patrick 56 Apr 6, 2021
High performance, simple Go web framework

Elton Elton的实现参考了koa以及echo,中间件的调整均为洋葱模型:请求由外至内,响应由内至外。主要特性如下: 处理函数(中间件)均以返回error的形式响应出错,方便使用统一的出错处理中间件将出错统一转换为对应的输出(JSON),并根据出错的类型等生成各类统计分析 成功响应数据直接赋值

Tree Xie 54 Sep 15, 2021
Go Language Facilitator

golf The Go Language Facilitator tool is used to process in-file code while copying a source to a destination file. It is basically helpful when diffe

null 4 May 6, 2021
Swagger + Gin = SwaGin, a web framework based on Gin and Swagger

Swagger + Gin = SwaGin Introduction SwaGin is a web framework based on Gin and Swagger, which wraps Gin and provides built-in swagger api docs and req

long2ice 15 Aug 31, 2021
Swagger + Gin = SwaGin, a web framework based on Gin and Swagger

Swagger + Gin = SwaGin Introduction SwaGin is a web framework based on Gin and Swagger, which wraps Gin and provides built-in swagger api docs and req

long2ice 15 Aug 31, 2021
Hexya business application development framework

Hexya Hexya is an open source ERP and a business application development framework written in Go. This repository houses the business application deve

Hexya 318 Sep 2, 2021