rubbernecker

package
v0.0.0-...-c6636e6 Latest Latest
Warning

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

Go to latest
Published: Mar 22, 2024 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BlockedFilter

type BlockedFilter struct{}

func (*BlockedFilter) DisplayText

func (*BlockedFilter) DisplayText() string

func (*BlockedFilter) IsApplied

func (*BlockedFilter) IsApplied(queries []string) bool

func (*BlockedFilter) QueryText

func (*BlockedFilter) QueryText() string

type Card

type Card struct {
	ID        int      `json:"id"`
	Assignees Members  `json:"assignees"`
	Elapsed   int      `json:"in_play"`
	Status    string   `json:"status"`
	Stickers  Stickers `json:"stickers"`
	Title     string   `json:"title"`
	URL       string   `json:"url"`
	StoryType string   `json:"story_type"`
	Estimate  *float64 `json:"estimate"`
}

Card will be a rubbernecker entity composed of the extension.

type Cards

type Cards []*Card

Cards will be a rubbernecker representative of all cards.

func (Cards) Filter

func (c Cards) Filter(s string) Cards

Filter the cards by status.

func (Cards) FilterBy

func (c Cards) FilterBy(filters []string) Cards

func (Cards) Reverse

func (c Cards) Reverse()

Reverse reverses the order of the cards in place

type CommentsToResolveFilter

type CommentsToResolveFilter struct{}

func (*CommentsToResolveFilter) DisplayText

func (*CommentsToResolveFilter) DisplayText() string

func (*CommentsToResolveFilter) IsApplied

func (*CommentsToResolveFilter) IsApplied(queries []string) bool

func (*CommentsToResolveFilter) QueryText

func (*CommentsToResolveFilter) QueryText() string

type Config

type Config struct {
	ReviewalLimit int
	ApprovalLimit int
}

Config will hold some basic settings for the rubbernecker frontend.

type CoreWorkFilter

type CoreWorkFilter struct{}

func (*CoreWorkFilter) DisplayText

func (*CoreWorkFilter) DisplayText() string

func (*CoreWorkFilter) IsApplied

func (*CoreWorkFilter) IsApplied(queries []string) bool

func (*CoreWorkFilter) QueryText

func (*CoreWorkFilter) QueryText() string

type DecommissionFilter

type DecommissionFilter struct{}

func (*DecommissionFilter) DisplayText

func (*DecommissionFilter) DisplayText() string

func (*DecommissionFilter) IsApplied

func (*DecommissionFilter) IsApplied(queries []string) bool

func (*DecommissionFilter) QueryText

func (*DecommissionFilter) QueryText() string

type DocumentationFilter

type DocumentationFilter struct{}

func (*DocumentationFilter) DisplayText

func (*DocumentationFilter) DisplayText() string

func (*DocumentationFilter) IsApplied

func (*DocumentationFilter) IsApplied(queries []string) bool

func (*DocumentationFilter) QueryText

func (*DocumentationFilter) QueryText() string

type Filter

type Filter interface {
	QueryText() string
	DisplayText() string
	IsApplied(queries []string) bool
}

func DefaultFilterSet

func DefaultFilterSet() []Filter

type Member

type Member struct {
	ID    int    `json:"id"`
	Email string `json:"email"`
	Name  string `json:"name"`
}

Member will be a rubbernecker entity composed of the extension.

type MemberService

type MemberService interface {
	FetchMembers() error
	FlattenMembers() (Members, error)
}

MemberService interface will establish a standard for any extension handling support data.

type Members

type Members map[int]*Member

Members will be a rubbernecker representative of all members.

type NonTechFilter

type NonTechFilter struct{}

func (*NonTechFilter) DisplayText

func (*NonTechFilter) DisplayText() string

func (*NonTechFilter) IsApplied

func (*NonTechFilter) IsApplied(queries []string) bool

func (*NonTechFilter) QueryText

func (*NonTechFilter) QueryText() string

type PairingFilter

type PairingFilter struct{}

func (*PairingFilter) DisplayText

func (*PairingFilter) DisplayText() string

func (*PairingFilter) IsApplied

func (*PairingFilter) IsApplied(queries []string) bool

func (*PairingFilter) QueryText

func (*PairingFilter) QueryText() string

type PersistanceEngine

type PersistanceEngine interface {
	Get(key string) (interface{}, error)
	Put(key string, value interface{}) error
}

PersistanceEngine interface should ensure any backing service will follow the same set of rules.

type ProjectManagementService

type ProjectManagementService interface {
	AcceptStickers(Stickers)
	FetchCards(Status, map[string]string) error
	FlattenStories() (Cards, error)
}

ProjectManagementService is an interface that should force each extension to flatten their story into rubbernecker format.

type Response

type Response struct {
	Card                 *Card       `json:"card,omitempty"`
	Cards                Cards       `json:"cards,omitempty"`
	SampleCard           *Card       `json:"sample_card,omitempty"`
	Config               *Config     `json:"config,omitempty"`
	Error                string      `json:"error,omitempty"`
	Message              string      `json:"message,omitempty"`
	SupportRota          SupportRota `json:"support,omitempty"`
	TeamMembers          Members     `json:"team_members,omitempty"`
	FreeTeamMembers      Members     `json:"free_team_members,omitempty"`
	Filters              []Filter    `json:"filers,omitempty"`
	AppliedFilterQueries []string    `json:"applied_filters,omitempty"`
	TextFilters          string      `json:"text_filters,omitempty"`
}

Response will be a standard outcome returned when hitting rubbernecker app.

func (*Response) JSON

func (r *Response) JSON(code int, w http.ResponseWriter) error

JSON function will execute the response to our HTTP writer.

func (*Response) Template

func (r *Response) Template(code int, w http.ResponseWriter, templateFile ...string) error

Template function will execute the response to our HTTP writer providing it with HTML.

func (*Response) WithAppliedFilterQueries

func (r *Response) WithAppliedFilterQueries(queries []string) *Response

WithAppliedFilterQueries will set the applied filter queries param for the current response.

func (*Response) WithCards

func (r *Response) WithCards(cards Cards, single bool) *Response

WithCards will set a collection/single card for the current response.

func (*Response) WithConfig

func (r *Response) WithConfig(config *Config) *Response

WithConfig will set a configuration that will be returned in a response.

func (*Response) WithError

func (r *Response) WithError(err error) *Response

WithError will set an error for the current response.

func (*Response) WithFilters

func (r *Response) WithFilters(filters []Filter) *Response

WithFilters will set the filters param for the current response

func (*Response) WithFreeTeamMembers

func (r *Response) WithFreeTeamMembers() *Response

WithFreeTeamMembers should prepare a list of team members that are free to pickup new work.

func (*Response) WithSampleCard

func (r *Response) WithSampleCard(card *Card) *Response

WithSampleCard will set a sample card used for template generation

func (*Response) WithSupport

func (r *Response) WithSupport(rota SupportRota) *Response

WithSupport will set either rota or a single support data for the current response.

func (*Response) WithTeamMembers

func (r *Response) WithTeamMembers(members Members) *Response

WithTeamMembers will set the allocated parameter for the current response.

func (*Response) WithTextFilters

func (r *Response) WithTextFilters(filters []string) *Response

WithTextFilters will set the text-filters param for the current response.

type ScheduledFilter

type ScheduledFilter struct{}

func (*ScheduledFilter) DisplayText

func (*ScheduledFilter) DisplayText() string

func (*ScheduledFilter) IsApplied

func (*ScheduledFilter) IsApplied(queries []string) bool

func (*ScheduledFilter) QueryText

func (*ScheduledFilter) QueryText() string

type SmallTaskFilter

type SmallTaskFilter struct{}

func (SmallTaskFilter) DisplayText

func (SmallTaskFilter) DisplayText() string

func (SmallTaskFilter) IsApplied

func (SmallTaskFilter) IsApplied(queries []string) bool

func (SmallTaskFilter) QueryText

func (SmallTaskFilter) QueryText() string

type Status

type Status int

Status is treated as an enum for the story status codes.

const (
	// StatusAll should bring up all the cards from a
	// ProjectManagementService.Fetch call.
	StatusAll Status = iota
	// StatusScheduled should only filter the stories that are not in the
	// StatusStarted state, but prioritised into backlog.
	StatusScheduled
	// StatusDoing should only filter the stories that are in play.
	StatusDoing
	// StatusReviewal should only filter the stories that are in progress of
	// reviewal.
	StatusReviewal
	// StatusApproval should only filter the stories that are in progress of
	// approval.
	StatusApproval
	// StatusRejected should only filter the stories that have been rejected upon
	// approval.
	StatusRejected
	// StatusDone should only filter the stories that are done.
	StatusDone
)

func (Status) String

func (s Status) String() string

type Sticker

type Sticker struct {
	Name     string
	Label    bool
	Regex    string
	Title    string
	Image    string
	Content  string
	Aliases  []string
	Class    string
	Priority int
	Value    string
}

Sticker is a rubbernecker definition of labels.

func (Sticker) Matches

func (s Sticker) Matches(query string) (Sticker, bool)

Matches will check if the sticker matches the query provided by the extension.

type Stickers

type Stickers []Sticker

Stickers is a simple slice of stickers

func (Stickers) Contains

func (ss Stickers) Contains(name string) bool

Contains returns true if the list has a sticker with the given name

func (Stickers) Get

func (ss Stickers) Get(query string) (Sticker, bool)

Get will run a quick check against the slice of stickers to see if one has been already added and will return it.

func (Stickers) Has

func (ss Stickers) Has(query string) bool

Has will run a quick check against the slice of stickers to see if one has been already added

func (Stickers) Len

func (ss Stickers) Len() int

Len is the number of elements in the collection Needed for implementing sort.Interface

func (Stickers) Less

func (ss Stickers) Less(i, j int) bool

Less reports whether the element with index i should sort before the element with index j Needed for implementing sort.Interface

func (Stickers) Swap

func (ss Stickers) Swap(i, j int)

Swap swaps the elements with indexes i and j Needed for implementing sort.Interface

type Support

type Support struct {
	Type   string `json:"type,omitempty"`
	Member string `json:"member,omitempty"`
}

Support struct will contain any useful information, relevant to our users.

type SupportRota

type SupportRota map[string]*Support

SupportRota will contain a unique list prefixed with a type of support.

func (SupportRota) Get

func (s SupportRota) Get(key string) *Support

Get returns with the given key or an empty value

type SupportService

type SupportService interface {
	FetchSupport() error
	FlattenSupport() (SupportRota, error)
}

SupportService interface will establish a standard for any extension handling support data.

type TechFilter

type TechFilter struct{}

func (*TechFilter) DisplayText

func (*TechFilter) DisplayText() string

func (*TechFilter) IsApplied

func (*TechFilter) IsApplied(queries []string) bool

func (*TechFilter) QueryText

func (*TechFilter) QueryText() string

Jump to

Keyboard shortcuts

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