GoRODS: github.com/jjacquay712/GoRODS/msi Index | Files

package msi

import "github.com/jjacquay712/GoRODS/msi"

Package msi is package that contains utilities for use in microservices written in Golang. GoRODS/msi provides a binding to the msParam_t type, and its various subtypes. In addition, it provides an interface for calling other microservices.


Package Files

microservice.go param.go reader.go types.go


const (
    SUCCESS                 = 0
    SYS_INTERNAL_ERR        = -154000

iRODS constants for use in microservice return value

func Call Uses

func Call(msiName string, params ...interface{}) error

Call invokes a microservice by name. The variadic arguments can be *msi.Param, string, int, or int64.

func Configure Uses

func Configure(ruleExecInfo unsafe.Pointer)

Configure accepts a ruleExecInfo_t*, cast as an unsafe.Pointer. This is a requirement for passing C types between packages. You must run this function prior to executing microservices with msi.Call

type ObjReader Uses

type ObjReader struct {
    // contains filtered or unexported fields

ObjReader provides a golang io.Reader interface for iRODS data object, identified by the INT_MS_T object reference

func NewObjReader Uses

func NewObjReader(irodsPath string) (*ObjReader, error)

NewObjReader accepts an iRODS data object path string, opens a reference to the object using msiDataObjOpen, and returns an *ObjReader which satisfies the io.Reader interface.

func NewObjReaderFromDesc Uses

func NewObjReaderFromDesc(desc *Param) *ObjReader

NewObjReaderFromDesc creates a new *ObjReader from an existing descriptor

func (*ObjReader) Close Uses

func (rdr *ObjReader) Close() error

Close calls msiDataObjClose on the opened data object handle.

func (*ObjReader) Read Uses

func (rdr *ObjReader) Read(data []byte) (n int, err error)

Read reads []bytes from data objects in iRODS. It satisfies the io.Reader interface.

func (*ObjReader) Write Uses

func (rdr *ObjReader) Write(data []byte) (n int, err error)

Write writes []bytes from data slice. It satisfies the io.Writer interface.

type Param Uses

type Param struct {
    // contains filtered or unexported fields

Param is the golang abstraction for *C.msParam_t types

func NewParam Uses

func NewParam(paramType ParamType) *Param

NewParam creates a new *Param, with the provided type string

func ToParam Uses

func ToParam(gParam unsafe.Pointer) *Param

ToParam creates a new *msi.Param from an existing *C.msParam_t

func (*Param) Bytes Uses

func (param *Param) Bytes() []byte

Bytes returns the []byte of BUF_LEN_MS_T type parameters

func (*Param) ConvertTo Uses

func (param *Param) ConvertTo(t ParamType) *Param

ConvertTo rebuilds the underlying data of msParam_t*, to the given ParamType. This is useful for setting the types of output parameters, since they are blank when passed to the microservice. If msParam_t* is nil, it is set to a newly allocated structure.

func (*Param) Int Uses

func (param *Param) Int() int

Int returns the integer value of the underlying INT_MS_T parameter

func (*Param) Ptr Uses

func (param *Param) Ptr() unsafe.Pointer

Ptr returns an unsafe.Pointer of the underlying *C.msParam_t

func (*Param) SetBytes Uses

func (param *Param) SetBytes(bytes []byte) *Param

SetBytes sets the underlying BUF_LEN_MS_T struct to the provided byte slice

func (*Param) SetDataObjInp Uses

func (param *Param) SetDataObjInp(input map[string]interface{}) *Param

SetDataObjInp sets the underlying DataObjInp_MS_T struct fields from a map Valid keys and values are: {"objPath": string, "createMode": int, "openFlags": int}

func (*Param) SetInt Uses

func (param *Param) SetInt(val int) *Param

SetInt sets the integer value of the underlying INT_MS_T parameter

func (*Param) SetKVP Uses

func (param *Param) SetKVP(data map[string]string) *Param

SetKVP adds key-value pairs to the underlying KeyValPair_MS_T parameter

func (*Param) SetString Uses

func (param *Param) SetString(val string) *Param

SetString sets the string value of the underlying STR_MS_T parameter

func (*Param) String Uses

func (param *Param) String() string

String converts STR_MS_T parameters to golang strings

func (*Param) Type Uses

func (param *Param) Type() ParamType

Type returns the ParamType of the given *Param

type ParamType Uses

type ParamType string
const (
    UNDEFINED_T                 ParamType = ""
    STR_MS_T                              = "STR_PI"
    INT_MS_T                              = "INT_PI"
    INT16_MS_T                            = "INT16_PI"
    CHAR_MS_T                             = "CHAR_PI"
    BUF_LEN_MS_T                          = "BUF_LEN_PI"
    STREAM_MS_T                           = "INT_PI"
    DOUBLE_MS_T                           = "DOUBLE_PI"
    FLOAT_MS_T                            = "FLOAT_PI"
    BOOL_MS_T                             = "BOOL_PI"
    DataObjInp_MS_T                       = "DataObjInp_PI"
    DataObjCloseInp_MS_T                  = "DataObjCloseInp_PI"
    DataObjCopyInp_MS_T                   = "DataObjCopyInp_PI"
    DataObjReadInp_MS_T                   = "dataObjReadInp_PI"
    DataObjWriteInp_MS_T                  = "dataObjWriteInp_PI"
    DataObjLseekInp_MS_T                  = "fileLseekInp_PI"
    DataObjLseekOut_MS_T                  = "fileLseekOut_PI"
    KeyValPair_MS_T                       = "KeyValPair_PI"
    TagStruct_MS_T                        = "TagStruct_PI"
    CollInp_MS_T                          = "CollInpNew_PI"
    ExecCmd_MS_T                          = "ExecCmd_PI"
    ExecCmdOut_MS_T                       = "ExecCmdOut_PI"
    RodsObjStat_MS_T                      = "RodsObjStat_PI"
    VaultPathPolicy_MS_T                  = "VaultPathPolicy_PI"
    StrArray_MS_T                         = "StrArray_PI"
    IntArray_MS_T                         = "IntArray_PI"
    GenQueryInp_MS_T                      = "GenQueryInp_PI"
    GenQueryOut_MS_T                      = "GenQueryOut_PI"
    XmsgTicketInfo_MS_T                   = "XmsgTicketInfo_PI"
    SendXmsgInfo_MS_T                     = "SendXmsgInfo_PI"
    GetXmsgTicketInp_MS_T                 = "GetXmsgTicketInp_PI"
    SendXmsgInp_MS_T                      = "SendXmsgInp_PI"
    RcvXmsgInp_MS_T                       = "RcvXmsgInp_PI"
    RcvXmsgOut_MS_T                       = "RcvXmsgOut_PI"
    StructFileExtAndRegInp_MS_T           = "StructFileExtAndRegInp_PI"
    RuleSet_MS_T                          = "RuleSet_PI"
    RuleStruct_MS_T                       = "RuleStruct_PI"
    DVMapStruct_MS_T                      = "DVMapStruct_PI"
    FNMapStruct_MS_T                      = "FNMapStruct_PI"
    MsrvcStruct_MS_T                      = "MsrvcStruct_PI"
    NcOpenInp_MS_T                        = "NcOpenInp_PI"
    NcInqIdInp_MS_T                       = "NcInqIdInp_PI"
    NcInqWithIdOut_MS_T                   = "NcInqWithIdOut_PI"
    NcInqInp_MS_T                         = "NcInqInp_PI"
    NcCloseInp_MS_T                       = "NcCloseInp_PI"
    NcGetVarInp_MS_T                      = "NcGetVarInp_PI"
    NcGetVarOut_MS_T                      = "NcGetVarOut_PI"
    NcInqOut_MS_T                         = "NcInqOut_PI"
    NcInqGrpsOut_MS_T                     = "NcInqGrpsOut_PI"
    Dictionary_MS_T                       = "Dictionary_PI"
    DictArray_MS_T                        = "DictArray_PI"
    GenArray_MS_T                         = "GenArray_PI"
    DataObjInfo_MS_T                      = "DataObjInfo_PI"

Types avaliable for use in msi.NewParam()

func (ParamType) String Uses

func (t ParamType) String() string

String returns the string value of the ParamType

Package msi imports 5 packages (graph). Updated 2017-06-09. Refresh now. Tools for package owners.