GithubHelp home page GithubHelp logo

isabella232 / godel-refreshables-plugin Goto Github PK

View Code? Open in Web Editor NEW

This project forked from palantir/godel-refreshables-plugin

0.0 0.0 0.0 4.01 MB

godel plugin that generates strongly-typed implementations of refreshable.Refreshable

License: Apache License 2.0

Shell 7.88% Go 92.12%

godel-refreshables-plugin's Introduction

Autorelease

godel-refreshables-plugin

A godel plugin for generating strongly-typed refreshable wrappers for arbitrary types.

For each target type, and the types required to construct it, the plugin will generate an interface definition (and implementation) which provides typed variants of the Current, Map, and Subscribe methods from the refreshable.Refreshable interface. Struct types additionally have generated methods to access each field as a Refreshable.

Plugin Configuration

The plugin reads a configuration file at godel/config/refreshables-plugin.yml which specifies the types for which Refreshable wrappers will be generated.

Example:

refreshables:
  # Relative path to local package
  ./pkg/mypackage:
    types:
      - MyType
  # Absolute path to local package
  github.com/user/project/pkg/mypackage:
    types:
      - MyType
  # Absolute path to remote package
  # In this case, an output path is required.
  github.com/otheruser/otherpackage:
    output: ./generated/otherpackage/zz_generated_refreshables.go
    types:
      - MyType

Excluding Fields From Code Generation

There are some cases where you may want to exclude specific fields in a struct from generation (for example if the field type is a third-party library struct that contains unexported fields). Fields can be excluded from generation by adding a refreshables tag with the value ",exclude". For example:

package mypackage

type MyType struct {
	FieldA string `yaml:"field-a"`
	// FieldB will not have refreshable methods/types generated for it
	FieldB string `yaml:"field-b" refreshables:",exclude"`
}

godel-refreshables-plugin's People

Contributors

berler avatar bmoylan avatar nmiyake avatar svc-autorelease avatar svc-excavator-bot avatar tabboud avatar

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.