Documentation ¶
Index ¶
- Constants
- func Catch(f func()) (r interface{})
- func Check(e error)
- func DenatureObject(data interface{}) map[string]interface{}
- func GetField(field string, i interface{}) interface{}
- func GetFieldByTag(ider interface{}, realtag string) (reflect.Value, reflect.StructField)
- func GetId(ider interface{}) string
- func GetIdField(ider interface{}) (reflect.Value, reflect.StructField)
- func IsZeroOfUnderlyingType(x interface{}) bool
- func Reply(a interface{})
- func SetField(field string, i interface{}, v interface{})
- func SetId(ider interface{}, id string) error
- func VerifyRelationship(lb Relationship) bool
- type API
- func (a *API) CentralFindRouter(r *Request, resourcestr, idstr string, preroute []string, ...)
- func (a *API) EntryCreate(r *Request)
- func (a *API) EntryDelete(r *Request)
- func (a *API) EntryFindDefault(r *Request)
- func (a *API) EntryFindRecordByResourceAndId(r *Request)
- func (a *API) EntryFindRelationshipByNameAndResourceId(r *Request)
- func (a *API) EntryFindRelationshipsByResourceId(r *Request)
- func (a *API) EntryUpdate(r *Request)
- func (a *API) GetRelationship(srcR, linkName string) *APIMountedRelationship
- func (a *API) GetRelationshipsByResource(resource string) map[string]*APIMountedRelationship
- func (a *API) GetResource(name string) *APIMountedResource
- func (a *API) InitRouter()
- func (a *API) MountRelationship(name, srcResourceName string, relationship Relationship, ...)
- func (a *API) MountResource(name string, resource Resource, authenticators ...Authenticator)
- func (a *API) ServeHTTP(w http.ResponseWriter, r *http.Request)
- func (a *API) Wrap(child func(r *Request)) httprouter.Handle
- type APIMountedRelationship
- func (amr *APIMountedRelationship) Resolve(r *Request, src *Record, shouldFetch bool, include *IncludeInstructions) (*ORelationship, []*Record)
- func (amr *APIMountedRelationship) ResolveIds(r *Request, lb RelationshipLinkIds, record *Record, ...) (*ORelationship, []*Record)
- func (amr *APIMountedRelationship) ResolveRecords(r *Request, lb RelationshipLinkRecords, record *Record, ...) (*ORelationship, []*Record)
- type APIMountedResource
- type Authenticator
- type AuthenticatorMany
- type Denaturer
- type Ider
- type IncludeInstructions
- type LeasedPromise
- type Logger
- type LoggerDefault
- func (l *LoggerDefault) Criticalf(format string, args ...interface{})
- func (l *LoggerDefault) Debugf(format string, args ...interface{})
- func (l *LoggerDefault) Errorf(format string, args ...interface{})
- func (l *LoggerDefault) GetCaller(depth int) string
- func (l *LoggerDefault) GetTime() string
- func (l *LoggerDefault) Infof(format string, args ...interface{})
- func (l *LoggerDefault) PrepareArgs(args []interface{}) []interface{}
- func (l *LoggerDefault) Warnf(format string, args ...interface{})
- type OData
- type OError
- type OErrorSource
- type OMeta
- type ORecords
- type ORelationship
- type ORelationships
- type OResourceIdentifier
- type Output
- type OutputType
- type Paginator
- type Promise
- type PromiseStorage
- type PromiseStorageLease
- type Record
- type RecordAttributes
- type RecordCreatedStatus
- type RecordParserSimple
- type Relationship
- type RelationshipLinkIds
- type RelationshipLinkRecords
- type RelationshipRequirement
- type Request
- type RequestParams
- type Resource
- type ResourceTypeSetter
- func (rts *ResourceTypeSetter) Create(r *Request, record *Record) (RecordCreatedStatus, error)
- func (rts *ResourceTypeSetter) Delete(r *Request, id string) error
- func (rts *ResourceTypeSetter) FindDefault(r *Request, rp RequestParams) ([]*Record, error)
- func (rts *ResourceTypeSetter) FindMany(r *Request, rp RequestParams, ids []string) ([]*Record, error)
- func (rts *ResourceTypeSetter) FindManyByField(r *Request, rp RequestParams, field, value string) ([]*Record, error)
- func (rts *ResourceTypeSetter) FindOne(r *Request, rp RequestParams, id string) (*Record, error)
- func (rts *ResourceTypeSetter) ParseJSON(r *Request, src *Record, raw []byte) (*Record, error)
- func (rts *ResourceTypeSetter) Set(records *[]*Record)
- func (rts *ResourceTypeSetter) Update(r *Request, record *Record) error
- type Responder
- type ResponderBase
- func InsufficientPermissions() *ResponderBase
- func NewResponderBase(status int, o *Output) *ResponderBase
- func NewResponderBaseErrors(code int, es ...error) *ResponderBase
- func NewResponderErrorOperationNotSupported(desc string) *ResponderBase
- func NewResponderErrorRelationshipDoesNotExist(relname string) *ResponderBase
- func NewResponderErrorResourceDoesNotExist(relname string) *ResponderBase
- func NewResponderForbidden(e error) *ResponderBase
- func NewResponderRecordCreate(resource_str string, rec *Record, createdStatus RecordCreatedStatus, err error) *ResponderBase
- func NewResponderResourceSuccessfullyDeleted() *ResponderBase
- func NewResponderUnimplemented(e error) *ResponderBase
- func TODO() *ResponderBase
- func Unimplemented() *ResponderBase
- type Task
- type TaskAttachIncluded
- type TaskContext
- type TaskCreate
- type TaskDelete
- type TaskFindByIds
- type TaskFindLinksByRecord
- type TaskFindLinksByRecordResult
- type TaskReplyer
- type TaskResultOutput
- type TaskResultRecordData
- type TaskResultRecords
- type TaskSingleLinkResolver
- type TaskUpdate
Constants ¶
const ( StatusCreated = 1 << iota StatusFailed StatusHasUserProvidedId StatusUserProvidedIdConflict StatusUnsupported )
Variables ¶
This section is empty.
Functions ¶
func Catch ¶
func Catch(f func()) (r interface{})
* Catch() functions similarly to most other languages try-catch... If a panic is thrown within the provided lambda, it will be intercepted and returned as an argument. If no error occurs, the return is nil.
func DenatureObject ¶
func DenatureObject(data interface{}) map[string]interface{}
func GetFieldByTag ¶
func GetFieldByTag(ider interface{}, realtag string) (reflect.Value, reflect.StructField)
func GetIdField ¶
func GetIdField(ider interface{}) (reflect.Value, reflect.StructField)
func IsZeroOfUnderlyingType ¶
func IsZeroOfUnderlyingType(x interface{}) bool
func Reply ¶
func Reply(a interface{})
* Reply() is just an alias for panic() -- it is syntax sugar in a few places.
func VerifyRelationship ¶
func VerifyRelationship(lb Relationship) bool
Types ¶
type API ¶
type API struct { Resources map[string]*APIMountedResource Relationships map[string]map[string]*APIMountedRelationship DefaultResourceWrapper func(*APIMountedResource) Router *httprouter.Router BaseURI string Logger Logger }
*
- API is the primary user-facing structure within this framework. It
- provides all of the functionality needed to intialize this framework,
- as well as all of the glue to step down into more specific functionality
func (*API) CentralFindRouter ¶
func (*API) EntryCreate ¶
func (*API) EntryDelete ¶
func (*API) EntryFindDefault ¶
func (*API) EntryFindRecordByResourceAndId ¶
func (*API) EntryFindRelationshipByNameAndResourceId ¶
func (*API) EntryFindRelationshipsByResourceId ¶
func (*API) EntryUpdate ¶
func (*API) GetRelationship ¶
func (a *API) GetRelationship(srcR, linkName string) *APIMountedRelationship
* GetRelationship() will return a single relationship for a given resource string and relationship string. If the resource or relationship does not exist, this function returns a nil pointer.
func (*API) GetRelationshipsByResource ¶
func (a *API) GetRelationshipsByResource(resource string) map[string]*APIMountedRelationship
* GetRelationshipsByResource() will return a list of all of the relationships that the given resource string can link to.
func (*API) GetResource ¶
func (a *API) GetResource(name string) *APIMountedResource
* GetResource() will return the resource for a given resource string. If the resource does not exist, this function returns a nil pointer.
func (*API) InitRouter ¶
func (a *API) InitRouter()
* InitRouter() prepares the internal httprouter object with all of the desired routes. This is called automatically. You should never have to call this unless you wish to muck around with the httprouter
func (*API) MountRelationship ¶
func (a *API) MountRelationship(name, srcResourceName string, relationship Relationship, authenticator Authenticator)
* MountRelationship() will take a given Relationship and make it available for requests sent to the given API. This also requires providing a source and destination Resource string. These resources must have already been mounted with MountResource() or this function will panic.
func (*API) MountResource ¶
func (a *API) MountResource(name string, resource Resource, authenticators ...Authenticator)
* MountResource() will take a given Resource and make it available for requests sent to the given API. Any Resource that is accessible goes through this function
func (*API) ServeHTTP ¶
func (a *API) ServeHTTP(w http.ResponseWriter, r *http.Request)
* ServeHTTP() is to satisfy net/http.Handler -- all requests are simply forwarded through to httprouter
func (*API) Wrap ¶
func (a *API) Wrap(child func(r *Request)) httprouter.Handle
* Wrap() reroutes a request to a standard httprouter.Handler (? double check) and converts it to the function signature that our entrypoint functions expect. It also initializes our panic handling and our thread pool handling.
type APIMountedRelationship ¶
type APIMountedRelationship struct { SrcResourceName string Name string Relationship Authenticator }
func (*APIMountedRelationship) Resolve ¶
func (amr *APIMountedRelationship) Resolve(r *Request, src *Record, shouldFetch bool, include *IncludeInstructions) (*ORelationship, []*Record)
func (*APIMountedRelationship) ResolveIds ¶
func (amr *APIMountedRelationship) ResolveIds(r *Request, lb RelationshipLinkIds, record *Record, include *IncludeInstructions) (*ORelationship, []*Record)
func (*APIMountedRelationship) ResolveRecords ¶
func (amr *APIMountedRelationship) ResolveRecords(r *Request, lb RelationshipLinkRecords, record *Record, include *IncludeInstructions) (*ORelationship, []*Record)
type APIMountedResource ¶
type APIMountedResource struct { Name string Resource Authenticator }
type Authenticator ¶
type AuthenticatorMany ¶
type AuthenticatorMany struct {
Authenticators []Authenticator
}
func NewAuthenticatorMany ¶
func NewAuthenticatorMany(authenticators ...Authenticator) *AuthenticatorMany
func (*AuthenticatorMany) Authenticate ¶
func (am *AuthenticatorMany) Authenticate(r *Request, permission, id string)
type IncludeInstructions ¶
type IncludeInstructions struct { Children map[string]*IncludeInstructions Include []string Parent *IncludeInstructions }
func NewIncludeInstructions ¶
func NewIncludeInstructions(rawinst string) *IncludeInstructions
func NewIncludeInstructionsEmpty ¶
func NewIncludeInstructionsEmpty() *IncludeInstructions
func NewIncludeInstructionsFromRequest ¶
func NewIncludeInstructionsFromRequest(r *http.Request) *IncludeInstructions
func (*IncludeInstructions) GetChild ¶
func (ii *IncludeInstructions) GetChild(childname string) *IncludeInstructions
func (*IncludeInstructions) Push ¶
func (ii *IncludeInstructions) Push(inst_rels []string)
func (*IncludeInstructions) ShouldFetch ¶
func (ii *IncludeInstructions) ShouldFetch(rel string) bool
func (*IncludeInstructions) ShouldInclude ¶
func (ii *IncludeInstructions) ShouldInclude(inst string) bool
type LeasedPromise ¶
func (*LeasedPromise) Release ¶
func (sp *LeasedPromise) Release()
type LoggerDefault ¶
func NewLoggerDefault ¶
func NewLoggerDefault(output io.Writer) *LoggerDefault
func (*LoggerDefault) Criticalf ¶
func (l *LoggerDefault) Criticalf(format string, args ...interface{})
func (*LoggerDefault) Debugf ¶
func (l *LoggerDefault) Debugf(format string, args ...interface{})
func (*LoggerDefault) Errorf ¶
func (l *LoggerDefault) Errorf(format string, args ...interface{})
func (*LoggerDefault) GetCaller ¶
func (l *LoggerDefault) GetCaller(depth int) string
func (*LoggerDefault) GetTime ¶
func (l *LoggerDefault) GetTime() string
func (*LoggerDefault) Infof ¶
func (l *LoggerDefault) Infof(format string, args ...interface{})
func (*LoggerDefault) PrepareArgs ¶
func (l *LoggerDefault) PrepareArgs(args []interface{}) []interface{}
func (*LoggerDefault) Warnf ¶
func (l *LoggerDefault) Warnf(format string, args ...interface{})
type OData ¶
type OData interface{}
OData is an interface used to represent the various forms of the primary data in the Output object. Currently, OutputData is an empty interface, so the use of this is purely syntactical. As of writing, the objects written in this file alongside OutputData are intended to be used as OutputData.
type OError ¶
type OError struct { Id string `json:"id,omitempty"` Href string `json:"href,omitempty"` Status string `json:"status,omitempty"` Code string `json:"code,omitempty"` Title string `json:"title,omitempty"` Detail string `json:"detail,omitempty"` Source *OErrorSource `json:"source,omitempty"` Meta interface{} `json:"meta,omitempty"` }
type OErrorSource ¶
type ORecords ¶
ORecords is a struct that satisfies OData, and represents a list of potentially many Records. A list of zero records is possible. Attempting to encode this object as JSON with a list of more than one Record when IsSingle = true will cause a panic.
func (ORecords) MarshalJSON ¶
type ORelationship ¶
type ORelationship struct { IsSingle bool `json:"-"` //Links OLinks `json:"links,omitempty"` Data []OResourceIdentifier `json:"data"` Meta OMeta `json:"meta,omitempty"` RelatedBase string `json:"-"` RelationshipName string `json:"-"` }
func (*ORelationship) MarshalJSON ¶
func (o *ORelationship) MarshalJSON() ([]byte, error)
type ORelationships ¶
type ORelationships struct {
Relationships []*ORelationship
}
func (*ORelationships) GetRelationshipByName ¶
func (o *ORelationships) GetRelationshipByName(name string) *ORelationship
func (*ORelationships) MarshalJSON ¶
func (o *ORelationships) MarshalJSON() ([]byte, error)
type OResourceIdentifier ¶
func GetRelationshipDifferences ¶
func GetRelationshipDifferences(src, dst []OResourceIdentifier) (add, remove []OResourceIdentifier)
func NewResourceIdentifier ¶
func NewResourceIdentifier(id, typ string) OResourceIdentifier
type Output ¶
type Output struct { Data OData `json:"data,omitempty"` //Links *OutputLinks `json:"links, omitempty"` Included []*Record `json:"included,omitempty"` Errors []OError `json:"errors,omitempty"` Meta OMeta `json:"meta,omitempty"` }
* Output is the primary output structure used by this framework. It is responsible for representing the root node of every spec-compliant response this framework can generate.
type OutputType ¶
type OutputType int
const ( OutputTypeResources OutputType = iota OutputTypeLinkages )
type Paginator ¶
func NewPaginator ¶
type PromiseStorage ¶
type PromiseStorage struct { Promises map[reflect.Type]chan PromiseStorageLease ChanGet chan PromiseStorageLease }
func NewPromiseStorage ¶
func NewPromiseStorage() *PromiseStorage
func (*PromiseStorage) Defer ¶
func (ps *PromiseStorage) Defer()
func (*PromiseStorage) Get ¶
func (ps *PromiseStorage) Get(typ Promise, init func() Promise) LeasedPromise
func (*PromiseStorage) PromiseWorker ¶
func (ps *PromiseStorage) PromiseWorker(p Promise) chan PromiseStorageLease
func (*PromiseStorage) Worker ¶
func (ps *PromiseStorage) Worker()
type PromiseStorageLease ¶
type PromiseStorageLease struct { Type reflect.Type Initialize func() Promise ChanResponse chan LeasedPromise }
type Record ¶
type Record struct { // exposed fields Type string `json:"type"` Id string `json:"id"` Attributes RecordAttributes `json:"attributes,omitempty"` //Links //TODO Relationships *ORelationships `json:"relationships,omitempty"` Meta OMeta `json:"meta,omitempty"` // internal fields for tracking ShouldInclude bool `json:"-"` // contains filtered or unexported fields }
func (*Record) GetRelationships ¶
func (r *Record) GetRelationships() *TaskFindLinksByRecordResult
func (*Record) GetResourceIdentifier ¶
func (r *Record) GetResourceIdentifier() OResourceIdentifier
func (*Record) PrepareRelationships ¶
func (r *Record) PrepareRelationships(req *Request, ii *IncludeInstructions)
type RecordAttributes ¶
type RecordAttributes interface{}
type RecordCreatedStatus ¶
type RecordCreatedStatus uint
type RecordParserSimple ¶
type RecordParserSimple struct {
Data *Record `json:"data"`
}
type Relationship ¶
type Relationship interface { IsSingle() bool PostMount(a *API) VerifyLinks(r *Request, rec *Record, amr *APIMountedRelationship, rids []OResourceIdentifier) error PreSave(r *Request, rec *Record, amr *APIMountedRelationship, rids []OResourceIdentifier) error PostSave(r *Request, rec *Record, amr *APIMountedRelationship, rids []OResourceIdentifier) error }
RelationshipBehavior is a "base interface" children: IdRelationshipBehavior or a HasIdRelationshipBehavior
type RelationshipLinkIds ¶
type RelationshipLinkIds interface { Relationship LinkIds(r *Request, srcR *APIMountedResource, rel *APIMountedRelationship, src *Record) (ids []OResourceIdentifier) }
type RelationshipLinkRecords ¶
type RelationshipLinkRecords interface { Relationship LinkRecords(r *Request, srcR *APIMountedResource, rel *APIMountedRelationship, src *Record) (dst []*Record) }
type RelationshipRequirement ¶
type RelationshipRequirement int
const ( Required RelationshipRequirement = iota NotRequired )
type Request ¶
type Request struct { HttpRequest *http.Request HttpResponseWriter http.ResponseWriter API *API Params httprouter.Params IncludeInstructions *IncludeInstructions TaskContext *TaskContext PromiseStorage *PromiseStorage // contains filtered or unexported fields }
* Request is responsible for managing all of the common information between resources and relationships for the duration of a request. It contains references to often-needed components such as the raw net/http.Request, the API object, etc
func NewRequest ¶
func NewRequest(a *API, httpreq *http.Request, httpres http.ResponseWriter, params httprouter.Params) *Request
* NewRequest() will return a populated instance of *Request. It will also initialize concurrency components.
func (*Request) Defer ¶
func (r *Request) Defer()
* Defer() should be called in a defer call at the same point that a Request is initialized. It is responsible for the safe handling of responses
func (*Request) Failure ¶
func (r *Request) Failure()
* Failure() is responsible for calling the appropriate failure handles. This function should never be called outside of a Responder
func (*Request) GetBaseURL ¶
* GetBaseURL() will provide the URL + URI for any arbitrary request such that curling the output of this function is the root API endpoint for requests to this instance of this framework.
func (*Request) HandlePanic ¶
* HandlePanic() is responsible for interpreting the object that was paniced, and replying with the appropriate answer.
type RequestParams ¶
type RequestParams struct {
Paginator Paginator
}
type Resource ¶
type Resource interface { FindDefault(r *Request, rp RequestParams) ([]*Record, error) FindOne(r *Request, rp RequestParams, id string) (*Record, error) FindMany(r *Request, rp RequestParams, ids []string) ([]*Record, error) FindManyByField(r *Request, rp RequestParams, field, value string) ([]*Record, error) // TODO: this iss necessary for optimizations but the backend // does not easily support this right now //FindManyByFieldWithManyValues(field string, []value string) ([]Ider, error) Delete(r *Request, id string) error ParseJSON(r *Request, src *Record, raw []byte) (dst *Record, err error) Create(r *Request, record *Record) (status RecordCreatedStatus, err error) Update(r *Request, record *Record) error }
type ResourceTypeSetter ¶
func NewResourceTypeSetter ¶
func NewResourceTypeSetter(parent Resource, name string, setEmptyOnly bool) *ResourceTypeSetter
func (*ResourceTypeSetter) Create ¶
func (rts *ResourceTypeSetter) Create(r *Request, record *Record) (RecordCreatedStatus, error)
func (*ResourceTypeSetter) Delete ¶
func (rts *ResourceTypeSetter) Delete(r *Request, id string) error
func (*ResourceTypeSetter) FindDefault ¶
func (rts *ResourceTypeSetter) FindDefault(r *Request, rp RequestParams) ([]*Record, error)
func (*ResourceTypeSetter) FindMany ¶
func (rts *ResourceTypeSetter) FindMany(r *Request, rp RequestParams, ids []string) ([]*Record, error)
func (*ResourceTypeSetter) FindManyByField ¶
func (rts *ResourceTypeSetter) FindManyByField(r *Request, rp RequestParams, field, value string) ([]*Record, error)
func (*ResourceTypeSetter) FindOne ¶
func (rts *ResourceTypeSetter) FindOne(r *Request, rp RequestParams, id string) (*Record, error)
func (*ResourceTypeSetter) Set ¶
func (rts *ResourceTypeSetter) Set(records *[]*Record)
type ResponderBase ¶
type ResponderBase struct { Output *Output Status int Headers map[string][]string CB func(r *Request) }
func InsufficientPermissions ¶
func InsufficientPermissions() *ResponderBase
func NewResponderBase ¶
func NewResponderBase(status int, o *Output) *ResponderBase
func NewResponderBaseErrors ¶
func NewResponderBaseErrors(code int, es ...error) *ResponderBase
func NewResponderErrorOperationNotSupported ¶
func NewResponderErrorOperationNotSupported(desc string) *ResponderBase
func NewResponderErrorRelationshipDoesNotExist ¶
func NewResponderErrorRelationshipDoesNotExist(relname string) *ResponderBase
func NewResponderErrorResourceDoesNotExist ¶
func NewResponderErrorResourceDoesNotExist(relname string) *ResponderBase
func NewResponderForbidden ¶
func NewResponderForbidden(e error) *ResponderBase
func NewResponderRecordCreate ¶
func NewResponderRecordCreate(resource_str string, rec *Record, createdStatus RecordCreatedStatus, err error) *ResponderBase
TODO: rip this out and replace it with multiple responder functions... this function should not be internally resonsible for determining success or failure
func NewResponderResourceSuccessfullyDeleted ¶
func NewResponderResourceSuccessfullyDeleted() *ResponderBase
func NewResponderUnimplemented ¶
func NewResponderUnimplemented(e error) *ResponderBase
func TODO ¶
func TODO() *ResponderBase
func Unimplemented ¶
func Unimplemented() *ResponderBase
func (*ResponderBase) PushHeader ¶
func (rb *ResponderBase) PushHeader(k, v string)
func (*ResponderBase) Respond ¶
func (rb *ResponderBase) Respond(r *Request) error
type TaskAttachIncluded ¶
type TaskAttachIncluded struct { Parent TaskResultRecords II *IncludeInstructions Output chan chan *Output ActualOutput *Output OutputType OutputType Linkname string }
func NewTaskAttachIncluded ¶
func NewTaskAttachIncluded(parent TaskResultRecords, ii *IncludeInstructions, outputtype OutputType, linkname string) *TaskAttachIncluded
func (*TaskAttachIncluded) Cleanup ¶
func (w *TaskAttachIncluded) Cleanup(r *Request)
func (*TaskAttachIncluded) GetResult ¶
func (w *TaskAttachIncluded) GetResult() *Output
func (*TaskAttachIncluded) ResponseWorker ¶
func (w *TaskAttachIncluded) ResponseWorker(has_paniced bool)
func (*TaskAttachIncluded) Work ¶
func (t *TaskAttachIncluded) Work(r *Request)
type TaskContext ¶
type TaskContext struct {
Context chan Task
}
* TaskContext's primary responsibility is managing a set of Tasks. It is also responsible for capturing panics and ensuring that every other task is informed of this such that as little computational power is wasted as possible once we are certain of our response.
func NewTaskContext ¶
func NewTaskContext(r *Request) *TaskContext
* NewTaskContext() creates and initializes a *TaskContext object, and initializes its worker goroutine
func (*TaskContext) Cleanup ¶
func (w *TaskContext) Cleanup()
func (*TaskContext) Push ¶
func (w *TaskContext) Push(t_list ...Task)
type TaskCreate ¶
func NewTaskCreate ¶
func NewTaskCreate(resource, id string) *TaskCreate
func (*TaskCreate) Cleanup ¶
func (t *TaskCreate) Cleanup(r *Request)
func (*TaskCreate) ResponseWorker ¶
func (t *TaskCreate) ResponseWorker(has_paniced bool)
func (*TaskCreate) Wait ¶
func (t *TaskCreate) Wait() bool
func (*TaskCreate) Work ¶
func (t *TaskCreate) Work(r *Request)
type TaskDelete ¶
func NewTaskDelete ¶
func NewTaskDelete(resource, id string) *TaskDelete
func (*TaskDelete) Cleanup ¶
func (t *TaskDelete) Cleanup(r *Request)
func (*TaskDelete) ResponseWorker ¶
func (t *TaskDelete) ResponseWorker(has_paniced bool)
func (*TaskDelete) Wait ¶
func (t *TaskDelete) Wait() bool
func (*TaskDelete) Work ¶
func (t *TaskDelete) Work(r *Request)
type TaskFindByIds ¶
type TaskFindByIds struct { Resource string Ids []string Output chan chan *TaskResultRecordData Result *TaskResultRecordData II *IncludeInstructions ViaLinkName string Paginator Paginator }
func NewTaskFindByIds ¶
func NewTaskFindByIds(resource string, ids []string, ii *IncludeInstructions, vln string, Paginator Paginator) *TaskFindByIds
func (*TaskFindByIds) Cleanup ¶
func (t *TaskFindByIds) Cleanup(r *Request)
func (*TaskFindByIds) GetResult ¶
func (t *TaskFindByIds) GetResult() *TaskResultRecordData
func (*TaskFindByIds) ResponseWorker ¶
func (t *TaskFindByIds) ResponseWorker(has_paniced bool)
func (*TaskFindByIds) Work ¶
func (t *TaskFindByIds) Work(r *Request)
type TaskFindLinksByRecord ¶
type TaskFindLinksByRecord struct { Record *Record II *IncludeInstructions Output chan chan *TaskFindLinksByRecordResult Result *TaskFindLinksByRecordResult }
func NewTaskFindLinksByRecord ¶
func NewTaskFindLinksByRecord(r *Record, ii *IncludeInstructions) *TaskFindLinksByRecord
func (*TaskFindLinksByRecord) Cleanup ¶
func (t *TaskFindLinksByRecord) Cleanup(r *Request)
func (*TaskFindLinksByRecord) GetResult ¶
func (t *TaskFindLinksByRecord) GetResult() *TaskFindLinksByRecordResult
func (*TaskFindLinksByRecord) ResponseWorker ¶
func (t *TaskFindLinksByRecord) ResponseWorker(has_paniced bool)
func (*TaskFindLinksByRecord) Work ¶
func (t *TaskFindLinksByRecord) Work(r *Request)
type TaskFindLinksByRecordResult ¶
type TaskFindLinksByRecordResult struct { Relationships *ORelationships Included []*Record }
type TaskReplyer ¶
type TaskReplyer struct { TaskResultOutput TaskResultOutput Output chan chan bool }
func NewTaskReplyer ¶
func NewTaskReplyer(wo TaskResultOutput) *TaskReplyer
func (*TaskReplyer) Cleanup ¶
func (w *TaskReplyer) Cleanup(r *Request)
func (*TaskReplyer) ResponseWorker ¶
func (w *TaskReplyer) ResponseWorker(has_paniced bool)
func (*TaskReplyer) Wait ¶
func (w *TaskReplyer) Wait()
func (*TaskReplyer) Work ¶
func (w *TaskReplyer) Work(r *Request)
type TaskResultOutput ¶
type TaskResultRecordData ¶
type TaskResultRecords ¶
type TaskResultRecords interface { Task GetResult() *TaskResultRecordData }
type TaskSingleLinkResolver ¶
type TaskSingleLinkResolver struct { Parent TaskResultRecords Linkname string Output chan chan *TaskResultRecordData Result *TaskResultRecordData }
func NewTaskSingleLinkResolver ¶
func NewTaskSingleLinkResolver(t TaskResultRecords, linkname string) *TaskSingleLinkResolver
func (*TaskSingleLinkResolver) Cleanup ¶
func (t *TaskSingleLinkResolver) Cleanup(r *Request)
func (*TaskSingleLinkResolver) GetResult ¶
func (t *TaskSingleLinkResolver) GetResult() *TaskResultRecordData
func (*TaskSingleLinkResolver) ResponseWorker ¶
func (t *TaskSingleLinkResolver) ResponseWorker(has_paniced bool)
func (*TaskSingleLinkResolver) Work ¶
func (t *TaskSingleLinkResolver) Work(r *Request)
TODO: make the parent_name in this function passed as an arg to NewTaskSingleLinkResolver instead of determining it from the result, as the current setup could create inconsistent behavior and is inherently incompatible with multi-type resources
type TaskUpdate ¶
func NewTaskUpdate ¶
func NewTaskUpdate(resource, id string) *TaskUpdate
func (*TaskUpdate) Cleanup ¶
func (t *TaskUpdate) Cleanup(r *Request)
func (*TaskUpdate) ResponseWorker ¶
func (t *TaskUpdate) ResponseWorker(has_paniced bool)
func (*TaskUpdate) Wait ¶
func (t *TaskUpdate) Wait() bool
func (*TaskUpdate) Work ¶
func (t *TaskUpdate) Work(r *Request)
Source Files ¶
- API.go
- APIEntrypoints.go
- APIMountedRelationship.go
- APIMountedResource.go
- Authenticator.go
- AuthenticatorMany.go
- DenatureObject.go
- Ider.go
- IncludeInstructions.go
- Logger.go
- LoggerDefault.go
- Output.go
- OutputData.go
- OutputError.go
- Paginator.go
- Promise.go
- PromiseStorage.go
- Record.go
- RecordCreatedStatus.go
- RecordParserSimple.go
- Relationship.go
- Request.go
- Resource.go
- ResourceTypeSetter.go
- Responder.go
- ResponderBase.go
- ResponderHelpers.go
- Task.go
- TaskAttachIncluded.go
- TaskContext.go
- TaskCreate.go
- TaskDelete.go
- TaskFindByIds.go
- TaskFindLinksByRecord.go
- TaskReplyer.go
- TaskResultOutput.go
- TaskResultRecord.go
- TaskSingleLinkResolver.go
- TaskUpdate.go
- util.go