hypothesis

package
v2.0.2 Latest Latest
Warning

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

Go to latest
Published: Jan 15, 2024 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

View Source
const PAGESIZE = 50

Variables

This section is empty.

Functions

This section is empty.

Types

type Annotation

type Annotation struct {
	Id          string            `json:"id"`
	Created     time.Time         `json:"created"`
	Updated     time.Time         `json:"updated"`
	User        string            `json:"user"`
	Uri         string            `json:"uri"`
	Text        string            `json:"text,omitempty"`
	Tags        []string          `json:"tags,omitempty"`
	Group       string            `json:"group,omitempty"`
	Permissions Permission        `json:"permissions,omitempty"`
	Target      []Target          `json:"target,omitempty"`
	Document    Document          `json:"document,omitempty"`
	Links       Links             `json:"links"`
	Flagged     bool              `json:"flagged"`
	Hidden      bool              `json:"hidden"`
	UserInfo    map[string]string `json:"user_info,omitempty"`
	// contains filtered or unexported fields
}

type AnnotationList

type AnnotationList struct {
	Total int64        `toml:"total"`
	Rows  []Annotation `toml:"rows"`
}

type Document

type Document struct {
	Title []string `toml:"title"`
}

type Group

type Group struct {
	Id           string `json:"id"`
	GroupID      string `json:"groupid,omitempty"`
	Name         string `json:"name"`
	Organization string `json:"organization,omitempty"`
	Public       bool   `json:"public"`
	Scoped       bool   `json:"scoped"`
	Type         string `json:"type"`
	Links        Links  `json:"links,omitempty"`
	// contains filtered or unexported fields
}

func (Group) GetAnnotations

func (grp Group) GetAnnotations(callback func(ann Annotation) error) error

type Hypothesis

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

func NewHypothesis

func NewHypothesis(endpoint, apikey string, log *logging.Logger) (*Hypothesis, error)

func (*Hypothesis) GetGroup

func (hy *Hypothesis) GetGroup(id string) (Group, error)

func (*Hypothesis) GetGroups

func (hy *Hypothesis) GetGroups(callback func(grp Group) error) error

func (*Hypothesis) GetUser

func (hy *Hypothesis) GetUser(id string) (User, error)

func (*Hypothesis) Search

func (hy *Hypothesis) Search(params map[string]string, callback func(ann Annotation) error) error

type Identity

type Identity struct {
	Provider         string `json:"provider,omitempty"`
	ProviderUniqueId string `json:"provider_unique_id,omitempty"`
}
type Links map[string]string

type Permission

type Permission struct {
	Read   []string `json:"read,omitempty"`
	Admin  []string `json:"admin,omitempty"`
	Update []string `json:"update,omitempty"`
	Delete []string `json:"delete,omitempty"`
}

type RangeSelector

type RangeSelector struct {
	Selector
	EndOffset      int64  `json:"endOffset"`
	StartOffset    int64  `json:"startOffset"`
	EndContainer   string `json:"endContainer,omitempty"`
	StartContainer string `json:"startContainer,omitempty"`
}

type Selector

type Selector struct {
	Type string `json:"type"`
}

type Target

type Target struct {
	Source   string                   `json:"source"`
	Selector []map[string]interface{} `json:"selector"`
}

type TextPositionSelector

type TextPositionSelector struct {
	Selector
	Start int64 `json:"start"`
	End   int64 `json:"end"`
}

type TextQuoteSelector

type TextQuoteSelector struct {
	Selector
	Exact  string `json:"exact"`
	Prefix string `json:"prefix"`
	Suffix string `json:"suffix"`
}

type User

type User struct {
	Authority   string     `json:"authority"`
	Username    string     `json:"username"`
	Email       string     `json:"email,omitempty"`
	DisplayName string     `json:"display_name"`
	Identities  []Identity `json:"identities,omitempty"`
	UserId      string     `json:"userid"`
	// contains filtered or unexported fields
}

func (User) GetAnnotations

func (user User) GetAnnotations(callback func(ann Annotation) error) error

Jump to

Keyboard shortcuts

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