Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

About yaml-parse #10

Open
slayercat opened this issue Aug 14, 2015 · 1 comment
Open

About yaml-parse #10

slayercat opened this issue Aug 14, 2015 · 1 comment

Comments

@slayercat
Copy link

We now have stats, stats-job, stats-tube. which returns yaml strings.

But from a user perspective, we do not want to deal with yaml. We want data wraped in yaml, not yaml itself.

To achieve this, I have API modification related problem and Implementation-related problem

API modification related problem

Which one looks good to you?

  1. provides a new api, which returns a dict.
parsed_item, err := beanstalkc_conn.StatsTube_Parsed("default")
  1. Modify the existing API definition.
    2a)
parsed_item, err := beanstalkc_conn.StatsTube("default", func(_ string) map[string]interface{} {
    panic("do something")
})

2b)

    parsed_item, err:= beanstalkc_conn.StatsTube("default")

Implementation-related problem

Which one looks good to you?

Of course. If you prefer 2a, we can leave this to users to decide.

  1. use https://github.com/kr/beanstalk/blob/master/parse.go
    This will not have any dependence introduced. and since kr used that, It shall looks good to us.

  2. use https://github.com/go-yaml/yaml
    A huge but seems well-tested library

@iwanbk
Copy link
Owner

iwanbk commented Aug 21, 2015

@slayercat thanks for this. I will check it over the weekend.
Very busy this last 2 weeks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants