bugzilla

package
v0.0.0-...-6356b95 Latest Latest
Warning

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

Go to latest
Published: Nov 29, 2024 License: Apache-2.0 Imports: 35 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewInformer

func NewInformer(client *Client, interval, maxInterval, resyncInterval time.Duration, argsFn func(metav1.ListOptions) SearchBugsArgs, includeFn func(*BugInfo) bool) cache.SharedIndexInformer

Types

type Bug

type Bug struct {
	metav1.TypeMeta
	metav1.ObjectMeta

	Info BugInfo
}

func NewBug

func NewBug(info *BugInfo) *Bug

func (Bug) DeepCopyObject

func (b Bug) DeepCopyObject() runtime.Object

type BugComment

type BugComment struct {
	ID           int         `json:"id"`
	IsPrivate    bool        `json:"is_private"`
	Creator      string      `json:"creator"`
	CreationTime metav1.Time `json:"creation_time"`
	Time         metav1.Time `json:"time"`
	Text         string      `json:"text"`
}

type BugCommentInfo

type BugCommentInfo struct {
	Comments []BugComment `json:"comments"`
}

type BugComments

type BugComments struct {
	metav1.TypeMeta
	metav1.ObjectMeta

	Info        BugInfo
	RefreshTime time.Time
	Comments    []BugComment
}

func NewBugComments

func NewBugComments(id int, info *BugCommentInfo) *BugComments

func ReadBugComments

func ReadBugComments(path string) (*BugComments, error)

func (BugComments) DeepCopyObject

func (b BugComments) DeepCopyObject() runtime.Object

type BugCommentsList

type BugCommentsList struct {
	Bugs map[IDString]BugCommentInfo `json:"bugs"`
}

type BugInfo

type BugInfo struct {
	ID                 int         `json:"id"`
	Status             string      `json:"status"`
	Resolution         string      `json:"resolution"`
	Severity           string      `json:"severity"`
	Priority           string      `json:"priority"`
	Summary            string      `json:"summary"`
	Keywords           []string    `json:"keywords"`
	Whiteboard         string      `json:"whiteboard"`
	InternalWhiteboard string      `json:"cf_internal_whiteboard"`
	Creator            string      `json:"creator"`
	Component          []string    `json:"component"`
	AssignedTo         string      `json:"assigned_to"`
	CreationTime       metav1.Time `json:"creation_time"`
	LastChangeTime     metav1.Time `json:"last_change_time"`
	Environment        string      `json:"cf_environment"`
	TargetRelease      []string    `json:"target_release"`
	Version            []string    `json:"version"`
}

type BugInfoList

type BugInfoList struct {
	Bugs   []BugInfo     `json:"bugs"`
	Faults []interface{} `json:"faults"`
}

type BugList

type BugList struct {
	metav1.TypeMeta
	metav1.ListMeta

	Items []Bug
}

func NewBugList

func NewBugList(bugs *BugInfoList, includeFn func(*BugInfo) bool) *BugList

func (*BugList) DeepCopyObject

func (b *BugList) DeepCopyObject() runtime.Object

type BugLister

type BugLister struct {
	// contains filtered or unexported fields
}

func NewBugLister

func NewBugLister(indexer cache.Indexer) *BugLister

NewBugLister lists bugs out of a cache.

func (*BugLister) Get

func (s *BugLister) Get(id int) (*Bug, error)

func (*BugLister) List

func (s *BugLister) List(selector labels.Selector) (ret []*Bug, err error)

type Client

type Client struct {
	Base    url.URL
	Client  *http.Client
	Retries int

	APIKey string
	Token  string
}

func NewClient

func NewClient(base url.URL) *Client

func (*Client) BugCommentsByID

func (c *Client) BugCommentsByID(ctx context.Context, bugs ...int) (*BugCommentsList, error)

func (*Client) BugsByID

func (c *Client) BugsByID(ctx context.Context, bugs ...int) (*BugInfoList, error)

func (*Client) SearchBugs

func (c *Client) SearchBugs(ctx context.Context, args SearchBugsArgs) (*BugInfoList, error)

type ClientError

type ClientError struct {
	Err Error
}

func (*ClientError) Error

func (e *ClientError) Error() string

type CommentAccessor

type CommentAccessor interface {
	Get(id int) (*BugComments, bool)
}

type CommentDiskStore

type CommentDiskStore struct {
	// contains filtered or unexported fields
}

func NewCommentDiskStore

func NewCommentDiskStore(path string, maxAge time.Duration) *CommentDiskStore

func (*CommentDiskStore) CloseBug

func (s *CommentDiskStore) CloseBug(bug *BugComments) error

func (*CommentDiskStore) DeleteBug

func (s *CommentDiskStore) DeleteBug(bug *Bug) error

func (*CommentDiskStore) NotifyChanged

func (s *CommentDiskStore) NotifyChanged(id int)

func (*CommentDiskStore) Run

func (s *CommentDiskStore) Run(ctx context.Context, lister *BugLister, store CommentAccessor, disableWrite bool)

func (*CommentDiskStore) Sync

func (s *CommentDiskStore) Sync(keys []string) ([]*BugComments, error)

type CommentStore

type CommentStore struct {
	// contains filtered or unexported fields
}

func NewCommentStore

func NewCommentStore(client *Client, refreshInterval time.Duration, includePrivate bool, persisted PersistentCommentStore) *CommentStore

func (*CommentStore) Get

func (s *CommentStore) Get(id int) (*BugComments, bool)

func (*CommentStore) Run

func (s *CommentStore) Run(ctx context.Context, informer cache.SharedInformer) error

func (*CommentStore) Stats

func (s *CommentStore) Stats() Stats

type Error

type Error struct {
	Error   bool   `json:"error"`
	Message string `json:"message"`
	Code    int    `json:"code"`
}

type IDString

type IDString int

func (*IDString) UnmarshalJSON

func (s *IDString) UnmarshalJSON(data []byte) error

type ListWatcher

type ListWatcher struct {
	// contains filtered or unexported fields
}

func (*ListWatcher) List

func (lw *ListWatcher) List(options metav1.ListOptions) (runtime.Object, error)

func (*ListWatcher) Watch

func (lw *ListWatcher) Watch(options metav1.ListOptions) (watch.Interface, error)

type PersistentCommentStore

type PersistentCommentStore interface {
	Sync(keys []string) ([]*BugComments, error)
	NotifyChanged(id int)
	DeleteBug(*Bug) error
	CloseBug(*BugComments) error
}

type SearchBugsArgs

type SearchBugsArgs struct {
	LastChangeTime time.Time
	IDs            []int
	Quicksearch    string

	IncludeFields []string
	Limit         int
	Offset        int
}

func (SearchBugsArgs) Add

func (arg SearchBugsArgs) Add(v url.Values)

type Stats

type Stats struct {
	Bugs int
}

Jump to

Keyboard shortcuts

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