GithubHelp home page GithubHelp logo

gostrufig's People

Contributors

achura avatar tim-kretschmer-c2fo avatar

Stargazers

 avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

gostrufig's Issues

Add Godoc Comments

The initial checkin is void of any Godoc comments. Add those so we can be a better community library.

Clean up Etcd code

Clean up the Etcd code so that it works properly with nested structs.

Allow Encryption of Member Values

When persisting and retrieving values for a persistence layer, Gostrufig should support encrypting and decrypting values using PGP or similar mechanism.

How should gostrufig handle populating array values?

I am testing out configs in the c2fo node and go baselines to see what features are missing in gull. There is a current mismatch between what gull puts into etcd for an array and what gostrufig reads into a struct.

Here's an example

func TestArrayParse(t *testing.T) {
    type MyStruct struct {
        ServiceHosts []string
    }
    blankStruct := MyStruct{}
    os.Setenv("C2FO_SERVICEHOSTS", "[host1:6379, host2:6379]")
    gostrufig := GetGostrufig("appname", "http://localhost:2379", nil)
    gostrufig.setInitialStructValues(&blankStruct, "c2fo")
    populatedStruct := MyStruct{
        ServiceHosts: []string{
            "host1:6379",
            "host2:6379",
        },
    }
    if reflect.DeepEqual(blankStruct, populatedStruct) {
        t.Log("Blank and populated structs are the same.")
    } else {
        fmt.Printf("POP: [%+v]\n", populatedStruct)
        fmt.Printf("LOD: [%+v]\n", blankStruct)
        t.Errorf("Comparison of blank and populated structs failed.")
    }
}

In gofigure all the values loaded into etcd are serialized JSON. However, gostrufig is expecting raw strings and then reflecting on them. Currently, gull can either store json encoded values or stringified values. Here is a golang array after it has been turned into a string.

"[host1:6379, host2:6379]"

@brockwood do you have any thoughts on how gostrufig can handle arrays? I assume gostrufig is the tool that would need tweaking, but if something else needs to be changed let me know.

I am currently thinking that gostrufig could have a naive array handler that splits the string and tries to parse the parts of the array using the reflection already present in gostrufig.

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.