[go-nuts] Command line tool to modify YAML files

2020-10-29 Thread Alex Breadman
Hi everyone,

I needed a tool today to insert or overwrite top-level values in a YAML 
file so that my CI pipeline can be cleaner and less complicated.

So I made a Go cmd tool called:

https://github.com/golangdaddy/yamlfukr

I hope someone finds this useful! I will be making a Github Action once I 
figure out how.

Please contribute where you think improvements can be made.

-- 
You received this message because you are subscribed to the Google Groups 
"golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to golang-nuts+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/golang-nuts/06e7afe6-1b69-4a43-94d5-17535ac14907n%40googlegroups.com.


Re: [go-nuts] Re: Command line tool to modify YAML files

2020-11-02 Thread alex breadman
Thanks for the reply.

I just did it for fun actually, and for the purpose of learning to make
GitHub actions.

I saw yq but it seemed like it was written in python, which I have no time
for.

The dasel one looks the best imo.



On Mon, 2 Nov 2020, 4:41 pm Howard C. Shaw III, 
wrote:

> If written because you needed experience and writing a program to perform
> a task you need done is better for learning, then go you! But if you are
> legitimately looking to solve a problem, you might want to throw a quick
> search out first before implementing Yet Another X.
>
> For yamlfukr update file.yaml key value:
> https://github.com/mikefarah/yq
> yq w -i file.yaml key value
>
> yq also supports b.c.d.e key names to edit deeper values.
>
> https://github.com/TomWright/dasel
>
> dasel put string -f file.yaml -p yaml "key" value
>
> dasel also supports b.c.d.e key names to edit deeper values.
>
> https://github.com/grasmash/yaml-cli
> yaml-cli update:value file.yml key value
>
> If you intend to keep developing yamlfukr
> , you might want to examine some
> of the alternatives, and if you find them unsuitable, add to your
> documentation why you find them so, so that someone coming on your project
> can see why they should consider going with your tool instead of one of the
> alternatives.
>
> --
> You received this message because you are subscribed to the Google Groups
> "golang-nuts" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to golang-nuts+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/golang-nuts/b1fb908a-94f7-4487-b76a-50153d87c868n%40googlegroups.com
> 
> .
>

-- 
You received this message because you are subscribed to the Google Groups 
"golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to golang-nuts+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/golang-nuts/CANaetAYF5USeu6OQivATC7TjciZfuCszK_-Lhok8ZxDsiBmWAw%40mail.gmail.com.


Re: [go-nuts] Re: Command line tool to modify YAML files

2020-11-02 Thread alex breadman
Not really.

I'll just rewrite them in go if there isn't a tool I need, or it the
interface is crappy. I have built a few databases from scratch, so writing
simple tools is trivial.



On Mon, 2 Nov 2020, 5:25 pm Tyler Compton,  wrote:

> I saw yq but it seemed like it was written in python, which I have no time
>> for.
>>
>
> You're going to be limiting your tooling options quite a bit in that case
> :)
>
> On Mon, Nov 2, 2020 at 8:49 AM alex breadman  wrote:
>
>> Thanks for the reply.
>>
>> I just did it for fun actually, and for the purpose of learning to make
>> GitHub actions.
>>
>> I saw yq but it seemed like it was written in python, which I have no
>> time for.
>>
>> The dasel one looks the best imo.
>>
>>
>>
>> On Mon, 2 Nov 2020, 4:41 pm Howard C. Shaw III, 
>> wrote:
>>
>>> If written because you needed experience and writing a program to
>>> perform a task you need done is better for learning, then go you! But if
>>> you are legitimately looking to solve a problem, you might want to throw a
>>> quick search out first before implementing Yet Another X.
>>>
>>> For yamlfukr update file.yaml key value:
>>> https://github.com/mikefarah/yq
>>> yq w -i file.yaml key value
>>>
>>> yq also supports b.c.d.e key names to edit deeper values.
>>>
>>> https://github.com/TomWright/dasel
>>>
>>> dasel put string -f file.yaml -p yaml "key" value
>>>
>>> dasel also supports b.c.d.e key names to edit deeper values.
>>>
>>> https://github.com/grasmash/yaml-cli
>>> yaml-cli update:value file.yml key value
>>>
>>> If you intend to keep developing yamlfukr
>>> <https://github.com/golangdaddy/yamlfukr>, you might want to examine
>>> some of the alternatives, and if you find them unsuitable, add to your
>>> documentation why you find them so, so that someone coming on your project
>>> can see why they should consider going with your tool instead of one of the
>>> alternatives.
>>>
>>> --
>>> You received this message because you are subscribed to the Google
>>> Groups "golang-nuts" group.
>>> To unsubscribe from this group and stop receiving emails from it, send
>>> an email to golang-nuts+unsubscr...@googlegroups.com.
>>> To view this discussion on the web visit
>>> https://groups.google.com/d/msgid/golang-nuts/b1fb908a-94f7-4487-b76a-50153d87c868n%40googlegroups.com
>>> <https://groups.google.com/d/msgid/golang-nuts/b1fb908a-94f7-4487-b76a-50153d87c868n%40googlegroups.com?utm_medium=email&utm_source=footer>
>>> .
>>>
>> --
>> You received this message because you are subscribed to the Google Groups
>> "golang-nuts" group.
>> To unsubscribe from this group and stop receiving emails from it, send an
>> email to golang-nuts+unsubscr...@googlegroups.com.
>> To view this discussion on the web visit
>> https://groups.google.com/d/msgid/golang-nuts/CANaetAYF5USeu6OQivATC7TjciZfuCszK_-Lhok8ZxDsiBmWAw%40mail.gmail.com
>> <https://groups.google.com/d/msgid/golang-nuts/CANaetAYF5USeu6OQivATC7TjciZfuCszK_-Lhok8ZxDsiBmWAw%40mail.gmail.com?utm_medium=email&utm_source=footer>
>> .
>>
>

-- 
You received this message because you are subscribed to the Google Groups 
"golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to golang-nuts+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/golang-nuts/CANaetAZcaAA9wJHkPuoO4adVd438L_vYH7PaVK%2B3Rg87%3DjNp1Q%40mail.gmail.com.


Re: [go-nuts] Thanks

2021-03-24 Thread alex breadman
Let's keep divisive political BS away from this lovely project.

Glad to see the political header removed from the website, at least on
mobile.

All lives matter.

On Wed, 24 Mar 2021, 8:41 pm Chris Burkert,  wrote:

> Several messages during the last weeks irritated me and I guess I was not
> the only one. Eventually we are all humans but often enough we don’t treat
> ourselves like that. Let’s treat machines like machines and humans like
> humans - not the other way round.
>
> That’s why I want to say “Thank you Gophers”! Thanks to to Rob, Ken an
> Robert for creating an awesome piece of software. Thanks to Russ and Ian
> for continuing this work. And thanks to all the contributors no matter for
> which company you work.
>
> There will never be a 100% agreement on implementation details and there
> will never be a perfect process for decision taking. I believe we are lucky
> to have people who can take hard decisions when needed but can also say
> “no”. I’d like to express my respect for their work. It’s too easy to blame
> others in charge not being in their shoes.
>
> Go is an awesome language with amazing tooling and the latest efforts will
> not suddenly morph it into a mess. For some it will further improve, for
> others it may become worse. But I believe that essentially Go will remain
> awesome.
>
> PS: please excuse me if I couldn’t find proper English terms. It’s already
> hard in my mother tongue with Kode and Code and Quellcode and Quelltext :-)
>
> --
> You received this message because you are subscribed to the Google Groups
> "golang-nuts" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to golang-nuts+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/golang-nuts/CALWqRZqjPwkn%3DF7FKUrsvfsUxkJxJkQqjpgOv1joUrbTK%3DJ2FQ%40mail.gmail.com
> 
> .
>

-- 
You received this message because you are subscribed to the Google Groups 
"golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to golang-nuts+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/golang-nuts/CANaetAaJq68N5%2BJUMW038CORnm-mn0OKopdBy1qGsQM0Lj7h_Q%40mail.gmail.com.


[go-nuts] html/template function not defined

2016-07-29 Thread alex . breadman
func encodeJSON(data interface{}) template.JS {
a, err := json.Marshal(data)
if err != nil { panic(err) }

return template.JS(a)
}

// code for rendering ELEMENT

func (ele *ELEMENT) Render() ([]byte, error) {

// init map of functions available to use within delimiters

if funcMap == nil {
funcMap = template.FuncMap{
"divideFF": divideFF,
"percentageFF": percentageFF,
"percentageIF": percentageIF,
"encodeJSON": encodeJSON,
}
}

when executing only the encodeJSON function I get this: template: x:19: 
function "encodeJSON" not defined

all others work fine, and I checked the correct code is in my gopath.

please advise... I had the encodeJSON func returning a string before but it 
didn't work either

-- 
You received this message because you are subscribed to the Google Groups 
"golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to golang-nuts+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[go-nuts] Re: html/template function not defined

2016-07-30 Thread alex . breadman

Since, I have made 2 more float-to-int functions and they work fine.

To solve this I'm having to pre-marshal my json before I execute the 
template.

Please if anyone knows why it doesn't like JSON encoding functions in the 
templates, let me know


On Saturday, July 30, 2016 at 4:32:12 AM UTC+2, 
alex.b...@leadinglocally.com wrote:
>
> func encodeJSON(data interface{}) template.JS {
> a, err := json.Marshal(data)
> if err != nil { panic(err) }
>
> return template.JS(a)
> }
>
> // code for rendering ELEMENT
>
> func (ele *ELEMENT) Render() ([]byte, error) {
>
> // init map of functions available to use within delimiters
>
> if funcMap == nil {
> funcMap = template.FuncMap{
> "divideFF": divideFF,
> "percentageFF": percentageFF,
> "percentageIF": percentageIF,
> "encodeJSON": encodeJSON,
> }
> }
>
> when executing only the encodeJSON function I get this: template: x:19: 
> function "encodeJSON" not defined
>
> all others work fine, and I checked the correct code is in my gopath.
>
> please advise... I had the encodeJSON func returning a string before but 
> it didn't work either
>

-- 
You received this message because you are subscribed to the Google Groups 
"golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to golang-nuts+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[go-nuts] HTTP2 package suddenly breaking all builds

2016-09-30 Thread alex . breadman

All my packages are unable to build because of this error

/home/alex/go/src/golang.org/x/net/http2/transport.go:1853: ctx.Done 
undefined (type contextContext is interface with no methods)
/home/alex/go/src/golang.org/x/net/http2/transport.go:1854: ctx.Err 
undefined (type contextContext is interface with no methods)

This issue just popped up on github issue 
tracker: https://github.com/golang/go/issues/17286 but was already closed 
by some kind of bot.

Please advise,

Many thanks...

-- 
You received this message because you are subscribed to the Google Groups 
"golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to golang-nuts+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[go-nuts] Is this algorithm viable? its faster than AES256 upto 50KB

2022-08-02 Thread Alex Breadman
package mod

import (
"testing"
)

func TestEncrypt(t *testing.T) {
password := []byte("*RTFUGIHOD&TUGGIYKl")
data := []byte("This encryption algorithm is faster than aes256 up to 40kb 
but how secure is it?")
for x, _ := range data {
p := (password[x%len(password)])
data[x] = data[x] + byte(p)
}
println(string(data))
for x, _ := range data {
p := (password[x%len(password)])
data[x] = data[x] - byte(p)
}
println(string(data))
}

Surely it is only as strong as the password?

Thanks

-- 
You received this message because you are subscribed to the Google Groups 
"golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to golang-nuts+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/golang-nuts/1c8a67cb-d7da-4c41-a8c5-92727d24e773n%40googlegroups.com.


[go-nuts] What is the idiomatic way to create dynamic clients for Firestore in Go

2023-12-27 Thread Alex Breadman
I want multi-tenancy but there is no clear documentation.

Is it supported yet in the firebase/firestore packages yet?

Thanks

-- 
You received this message because you are subscribed to the Google Groups 
"golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to golang-nuts+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/golang-nuts/ff599a86-4292-4f2f-a910-631e0e7ca7c1n%40googlegroups.com.


[go-nuts] Re: What is the idiomatic way to create dynamic clients for Firestore in Go

2023-12-27 Thread Alex Breadman
There is no clear way to specify a database

On Thursday, December 28, 2023 at 4:51:02 AM UTC Alex Breadman wrote:

> I want multi-tenancy but there is no clear documentation.
>
> Is it supported yet in the firebase/firestore packages yet?
>
> Thanks
>

-- 
You received this message because you are subscribed to the Google Groups 
"golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to golang-nuts+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/golang-nuts/b9f09c68-1ebd-47b7-be83-1f179e59e397n%40googlegroups.com.