Coder Social home page Coder Social logo

rokka-go's People

Contributors

chregu avatar dbu avatar dpacassi avatar mweibel avatar pstadler avatar thepanz avatar

Stargazers

 avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

Forkers

thepanz

rokka-go's Issues

Nicely formatted CLI output

(Not just a JSON output anymore)

  • By default CLI commands return a nicely formatted, human readable output
  • A flag is supported to retrieve the JSON response (e.g. -raw)

Sourceimages search rangeable querystring params

Searching sourceimages can be done on various fields in various ways. How we currently implement it is that you can pass a string for each of those values and define on your own whether you want to use a range or just a value.
This is not very typesafe and could be made easier by the library. Question is: is it worth the effort?
An example of how we could implement that for the string type (untested code):

type MaybeRangedString struct {
	Val string
	Range RangedString
}

func (mrs *MaybeRangedString) EncodeValues(key string, v *url.Values) error {
	if mrs.Val != "" {
		v.Set(key, mrs.Val)
		return nil
	} else {
		return mrs.Range.Encode(key, v)
	}
}

// RangedString is a string with from and to values.
// FromExclusive/ToExclusive define how the query string range is passed.
//
// From needs to be set always.
type RangedString struct {
	From          string
	To            string
	FromExclusive bool
	ToExclusive   bool
}

// EncodeValues implements query.Encoder for custom range encoding.
func (rs *RangedString) EncodeValues(key string, v *url.Values) error {
	s := ""
	if rs.FromExclusive {
		s += "{"
	} else {
		s += "["
	}
	s += rs.From
	if rs.To != "" {
		s += "," + rs.To
	}
	if rs.ToExclusive {
		s += "}"
	} else {
		s += "]"
	}
	v.Set(key, s)

	return nil
}

Similar implementations would have to be provided for the other types, though some things can probably be reused accross the types.

Opinions?

missing new line in CLI output

chregu@pri14:~/tmp$ rokka stacks delete $YOUR_ORG test
Stack successfully deletedchregu@pri14:~/tmp$

There should be a new line after "deleted"

Show image URL for sourceimages

to be able to immediately open the sourceimage in the browser and see how it looks like.
Probably needs some way to use the image host to generate the URL. May not be possible just with a template change.

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.