mt icon indicating copy to clipboard operation
mt copied to clipboard

Using as a library

Open prologic opened this issue 4 years ago • 10 comments

Hi,

I'd like to use this as a library. Would you be open to restructuing the code a little to support this?

Thanks!

prologic avatar Mar 21 '20 00:03 prologic

I had plans to do this for a while already sadly I did not find the time to do this.

With the recent events I’ve got my hopes up again... so yeah I hope I’ll get to refactor it in the near future.

Any special wishes? If so let me know ;)

mutschler avatar Mar 21 '20 19:03 mutschler

Please see my usage of mt here:

https://github.com/prologic/tube/blob/1db57c8d3bf7a960871dd73b72130f22a7d81ef3/media/video.go#L81-L89

prologic avatar Mar 22 '20 23:03 prologic

Making this suitable as a library means I can do a couple of things:

  • Stop using the golang:alpine image for runtime and compile directly the things I nee/duse
  • Stop installing the mt binary

See: https://github.com/prologic/tube/blob/1db57c8d3bf7a960871dd73b72130f22a7d81ef3/Dockerfile#L5-L9

prologic avatar Mar 22 '20 23:03 prologic

Ok so basically just normal functionality but usable as a library? Should be doable ;)

mutschler avatar Mar 23 '20 11:03 mutschler

Yes please :)

prologic avatar Mar 23 '20 22:03 prologic

I would be also interested :) For more details please feel free to have a look at https://majamee.de for more project details. Thank you very much for your consideration.

majamee avatar Jun 13 '21 21:06 majamee

I'd be down to help with the refactor if folks were still interested.

GlottalTrill avatar May 17 '23 23:05 GlottalTrill

@GlottalTrill i've started this several times, but couldn't decide how i want to implement it and wasn't really satisfied with anything i've got... no it's more of a time thing for me.

But if you want to give it a try go ahead i'd be happy to accept any PR if you get something useful done :)

mutschler avatar May 19 '23 09:05 mutschler

Indeed. I'll start reading the code base and post a possible strategy for creating independently "consumable" modules with the existing functions.

GlottalTrill avatar May 19 '23 11:05 GlottalTrill

I just opened a PR for review. I'm open to feedback or questions. The focus of my changes if not to change the behavior of the existing code, just bring it more inline with current go practices.

GlottalTrill avatar May 22 '23 11:05 GlottalTrill