Git Product home page Git Product logo

chronos's Introduction

The Reflect Go Library

GoDoc: https://godoc.org/github.com/reflect/reflect-go

Note: At the moment, the Reflect Go client is used only for generating authentication tokens to pass to client-side Reflect views. In the future we will release a more fully-featured Go client for the Reflect REST API.

Installation

You can install the reflect-go library using go get:

$ go get github.com/reflect/reflect-go

Importing

import (
        "github.com/reflect/reflect-go"
)

It's important to note that there is also a core Go library named reflect. To avoid conflicts with this library, you can rename your reflect-go import:

import (
        rf "github.com/reflect/reflect-go"
)

Generating Authentication Tokens

At the moment, this library is used for generating authentication tokens for use in Reflect views. To generate new tokens:

accessKey := "d232c1e5-6083-4aa7-9042-0547052cc5dd"
secretKey := "74678a9b-685c-4c14-ac45-7312fe29de06"

token, err := reflect.NewProjectTokenBuilder(accessKey).
    WithAttribute("user-id", 1234).
    WithAttribute("user-name", "Billy Bob").
    WithParameter(reflect.Parameter{
        Field: "My Field",
        Op: reflect.EqualsOperation,
        Value: "My Value",
    }).
    Build(secretKey)

chronos's People

Contributors

anapsix avatar andykram avatar aquamatthias avatar arron-green avatar azakkerman avatar brndnmtthws avatar califax avatar carroux avatar chengweiv5 avatar chicagoscala avatar depay avatar drexin avatar dterror-zz avatar elingg avatar florianleibert avatar fuziontech avatar gkleiman avatar gregbowyer avatar guenter avatar hshoff avatar m1k3 avatar meelapshah avatar philipnrmn avatar sdwr98 avatar solidsnack avatar sralmai avatar ssk2 avatar ssorallen avatar turb avatar wndhydrnt avatar

Watchers

 avatar  avatar  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.