Code Monkey home page Code Monkey logo

soffit-go's Introduction

soffit

-- import "astuart.co/soffit-go"

Package soffit provides data structures for the data types one can expect from the uPortal Soffit portlet. This should help enable more rapid iteration when working in a soffit environment.

Usage

type Context

type Context struct {
	PortalInfo            PortalInfo `json:"portalInfo"`
	SupportedWindowStates []string   `json:"supportedWindowStates"`
	Attributes            url.Values `json:"attributes"`
}

Context represents information about the portal creating the request

type Payload

type Payload struct {
	Request Request     `json:"request"`
	User    UserDetails `json:"user"`
	Context Context     `json:"context"`
}

Payload is the tentative name for the main Soffit request body

type PortalInfo

type PortalInfo struct {
	Provider string         `json:"provider"`
	Version  semver.Version `json:"version"`
	Snapshot bool           `json:"snapshot"`
}

PortalInfo is the representation of the portal information sent by the uPortal server.

func (*PortalInfo) UnmarshalJSON

func (p *PortalInfo) UnmarshalJSON(bs []byte) error

UnmarshalJSON implements json.Unmarshaler

type Request

type Request struct {
	Mode        string `json:"mode"`
	WindowID    string `json:"windowId"`
	Namespace   string `json:"namespace"`
	WindowState string `json:"windowState"`

	Properties  map[string]string `json:"properties"`
	Preferences url.Values        `json:"preferences"`
	Attributes  url.Values        `json:"attributes"`
}

Request is the go representation of the Soffit JSON request format v_1.

type UserDetails

type UserDetails struct {
	Username   string     `json:"username"`
	Attributes url.Values `json:"attributes"`
	Roles      []string   `json:"roles"`
	Groups     []string   `json:"groups"`
}

UserDetails is the representation of the user information sent by uPortal.

soffit-go's People

Contributors

andrewstuart avatar

Watchers

 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.