message

package
v0.0.0-...-049676f Latest Latest
Warning

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

Go to latest
Published: Jun 30, 2022 License: AGPL-3.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type DimensionDescription

type DimensionDescription struct {
	Dimension int   `json:"dimension"`
	Size      int   `json:"size"`
	Keys      []int `json:"keys"`
}

func (*DimensionDescription) Pack

func (m *DimensionDescription) Pack() ([]byte, error)

type Manifest

type Manifest struct {
	Dimensions [][]int `json:"dimensions"`
}

func (*Manifest) Pack

func (m *Manifest) Pack() ([]byte, error)

func (*Manifest) Unpack

func (m *Manifest) Unpack(doc []byte) (*Manifest, error)

type Message

type Message interface {
	Pack() ([]byte, error)
}

type ProcessHeader

type ProcessHeader struct {
	/*
	 * The number of separate parts this is broken into, where each part can be
	 * handled by a separate worker. This is the number of "bundles"
	 * (parts-of-results) the client will receive.
	 */
	Ntasks    int `msgpack:"nbundles"`
	RawHeader []byte
}

* This document is written as a "process header" in redis when a process is * scheduled, and holds the required information to build the response header. * The response header are parameters the client can use to determine how to * parse the response and properly pre-allocate buffers.

func (*ProcessHeader) Pack

func (m *ProcessHeader) Pack() ([]byte, error)

func (*ProcessHeader) Unpack

func (m *ProcessHeader) Unpack(doc []byte) (*ProcessHeader, error)

type Query

type Query struct {
	Pid             string          `json:"pid"`
	UrlQuery        string          `json:"url-query"`
	Guid            string          `json:"guid"`
	Manifest        json.RawMessage `json:"manifest"`
	StorageEndpoint string          `json:"storage_endpoint"`
	Function        string          `json:"function"`
	Args            interface{}     `json:"args"`
	Opts            interface{}     `json:"opts"`
}

* Corresponds to basic_query and derivatives in oneseismic/messages.hpp. This * is the process prototype that groups request parameters, request metadata, * authorization etc. into a single message.

func (*Query) Pack

func (msg *Query) Pack() ([]byte, error)

func (*Query) Unpack

func (msg *Query) Unpack(doc []byte) (*Query, error)

type Task

type Task struct {
	Pid             string `json:"pid"`
	Token           string `json:"token"`
	UrlQuery        string `json:"url-query"`
	Guid            string `json:"guid"`
	StorageEndpoint string `json:"storage_endpoint"`
	Function        string `json:"function"`
}

* Corresponds to basic_task and derivatives in oneseismic/messages.hpp, and * is read from the worker nodes when performing a task, which combined makes * up a process.

* Only the useful (to go) fields are parsed - the actual document has more * fields.

func (*Task) Pack

func (msg *Task) Pack() ([]byte, error)

func (*Task) Unpack

func (msg *Task) Unpack(doc []byte) (*Task, error)

Jump to

Keyboard shortcuts

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