presenters

package
v0.0.0-...-4471eec Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 23, 2015 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Conversation

type Conversation struct {
	ID      string `json:"id"`
	Title   string `json:"title"`
	Purpose string `json:"purpose"`

	Namespace struct {
		ID        string `json:"id,omitempty"`
		Path      string `json:"path,omitempty"`
		OwnerType string `json:"owner_type"`
	} `json:"namespace,omitempty"`
}

Conversation is a presenter for the schema.Conversation model

func ConversationCollectionPresenter

func ConversationCollectionPresenter(items []*schema.Conversation) []*Conversation

ConversationCollectionPresenter creates an array of presenters for the Conversation model

func ConversationPresenter

func ConversationPresenter(c *schema.Conversation) *Conversation

ConversationPresenter creates a new instance of the presenter for the Conversation model

func (*Conversation) GetLocation

func (c *Conversation) GetLocation() *url.URL

GetLocation returns the API location for the organization resource

type Locationable

type Locationable interface {
	GetLocation() *url.URL
}

type Map

type Map map[string]interface{}

type Member

type Member struct {
	ID               string    `json:"id"`
	UserID           string    `json:"user_id"`
	OrganizationID   string    `json:"org_id"`
	State            string    `json:"status"`
	Published        bool      `json:"published"`
	InvitedBy        string    `json:"invited_by,omitempty"`
	InviteEmail      string    `json:"invite_email,omitempty"`
	InviteSentAt     time.Time `json:"invite_sent_at,omitempty"`
	InviteAcceptedAt time.Time `json:"invite_accepted_at,omitempty"`
	CreatedAt        time.Time `json:"created_at"`
	UpdatedAt        time.Time `json:"updated_at"`
}

Member presents the schema.Member record that is return to the API responses

func MemberCollectionPresenter

func MemberCollectionPresenter(items []*schema.Member) []*Member

MemberCollectionPresenter creates a collection of presenters for Member

func MemberPresenter

func MemberPresenter(m *schema.Member) *Member

MemberPresenter creates a new instance of the Member presenter

type Organization

type Organization struct {
	ID          string    `json:"id"`
	Name        string    `json:"name"`
	Description string    `json:"description"`
	URL         string    `json:"url"`
	Location    string    `json:"location"`
	Email       string    `json:"email"`
	CreatedAt   time.Time `json:"created_at"`
	UpdatedAt   time.Time `json:"updated_at"`

	Namespace struct {
		ID        string `json:"id,omitempty"`
		Path      string `json:"path,omitempty"`
		OwnerType string `json:"owner_type"`
	} `json:"namespace,omitempty"`
}

Organization is a presenter for the schema.Organization model

func OrganizationCollectionPresenter

func OrganizationCollectionPresenter(items []*schema.Organization) []*Organization

OrganizationCollectionPresenter creates an array of presenters for the Organization model

func OrganizationPresenter

func OrganizationPresenter(o *schema.Organization) *Organization

OrganizationPresenter creates a new instance of the presenter for the Organization model

func (*Organization) GetLocation

func (o *Organization) GetLocation() *url.URL

GetLocation returns the API location for the organization resource

type Presentable

type Presentable interface {
	ToPresenterMap() Map
}

type User

type User struct {
	ID           string `json:"id"`
	Username     string `json:"username"`
	FullName     string `json:"full_name,omitempty"`
	PrimaryEmail string `json:"primary_email,omitempty"`

	Namespace struct {
		ID        string `json:"id,omitempty"`
		Path      string `json:"path,omitempty"`
		OwnerType string `json:"owner_type"`
	} `json:"namespace,omitempty"`
}

User represents a API user.

func UserCollectionPresenter

func UserCollectionPresenter(items []*schema.User) []*User

UserCollectionPresenter creates an array of presenters for the User model

func UserPresenter

func UserPresenter(u *schema.User) *User

UserPresenter creates a new instance of the presenter for the User model

func (*User) GetLocation

func (u *User) GetLocation() *url.URL

GetLocation returns the API location for the user resource

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL