commonform_grpc

package
v0.9.1 Latest Latest
Warning

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

Go to latest
Published: Jun 6, 2019 License: BlueOak-1.0.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Document_DocumentMeta_InputFormat_name = map[int32]string{
	0: "commonmark",
	1: "json",
	2: "markup",
}
View Source
var Document_DocumentMeta_InputFormat_value = map[string]int32{
	"commonmark": 0,
	"json":       1,
	"markup":     2,
}
View Source
var ToAssemble_NumberFormat_name = map[int32]string{
	0: "decimal",
	1: "outline",
}
View Source
var ToAssemble_NumberFormat_value = map[string]int32{
	"decimal": 0,
	"outline": 1,
}
View Source
var ToAssemble_OutputFormat_name = map[int32]string{
	0: "docx",
	1: "html",
	2: "html5",
	3: "markdown",
}
View Source
var ToAssemble_OutputFormat_value = map[string]int32{
	"docx":     0,
	"html":     1,
	"html5":    2,
	"markdown": 3,
}

Functions

func RegisterCommonFormEngineServer

func RegisterCommonFormEngineServer(s *grpc.Server, srv CommonFormEngineServer)

Types

type Blanks

type Blanks struct {
	Blanks               []string `protobuf:"bytes,1,rep,name=blanks,proto3" json:"blanks,omitempty"`
	XXX_NoUnkeyedLiteral struct{} `json:"-"`
	XXX_unrecognized     []byte   `json:"-"`
	XXX_sizecache        int32    `json:"-"`
}

The Blanks message is a simple wrapper around an array of strings since we cannot return arrays.

func (*Blanks) Descriptor

func (*Blanks) Descriptor() ([]byte, []int)

func (*Blanks) GetBlanks

func (m *Blanks) GetBlanks() []string

func (*Blanks) ProtoMessage

func (*Blanks) ProtoMessage()

func (*Blanks) Reset

func (m *Blanks) Reset()

func (*Blanks) String

func (m *Blanks) String() string

func (*Blanks) XXX_DiscardUnknown

func (m *Blanks) XXX_DiscardUnknown()

func (*Blanks) XXX_Marshal

func (m *Blanks) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*Blanks) XXX_Merge

func (m *Blanks) XXX_Merge(src proto.Message)

func (*Blanks) XXX_Size

func (m *Blanks) XXX_Size() int

func (*Blanks) XXX_Unmarshal

func (m *Blanks) XXX_Unmarshal(b []byte) error

type CommonFormEngineClient

type CommonFormEngineClient interface {
	// Extracts the paramters.
	Extract(ctx context.Context, in *Document, opts ...grpc.CallOption) (*Blanks, error)
	// Assembles the document.
	Assemble(ctx context.Context, in *ToAssemble, opts ...grpc.CallOption) (*Document, error)
}

CommonFormEngineClient is the client API for CommonFormEngine service.

For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream.

func NewCommonFormEngineClient

func NewCommonFormEngineClient(cc *grpc.ClientConn) CommonFormEngineClient

type CommonFormEngineServer

type CommonFormEngineServer interface {
	// Extracts the paramters.
	Extract(context.Context, *Document) (*Blanks, error)
	// Assembles the document.
	Assemble(context.Context, *ToAssemble) (*Document, error)
}

CommonFormEngineServer is the server API for CommonFormEngine service.

type Document

type Document struct {
	Meta                 *Document_DocumentMeta `protobuf:"bytes,1,opt,name=meta,proto3" json:"meta,omitempty"`
	Data                 []byte                 `protobuf:"bytes,2,opt,name=data,proto3" json:"data,omitempty"`
	XXX_NoUnkeyedLiteral struct{}               `json:"-"`
	XXX_unrecognized     []byte                 `json:"-"`
	XXX_sizecache        int32                  `json:"-"`
}

The Document message is a fairly straight-forward and object which includes a modicum of meta data which is needed both by the cf-server as well as clients of this server along with a filename and the contents of the file as a byte slice (golang) or a bytes buffer (node).

func (*Document) Descriptor

func (*Document) Descriptor() ([]byte, []int)

func (*Document) GetData

func (m *Document) GetData() []byte

func (*Document) GetMeta

func (m *Document) GetMeta() *Document_DocumentMeta

func (*Document) ProtoMessage

func (*Document) ProtoMessage()

func (*Document) Reset

func (m *Document) Reset()

func (*Document) String

func (m *Document) String() string

func (*Document) XXX_DiscardUnknown

func (m *Document) XXX_DiscardUnknown()

func (*Document) XXX_Marshal

func (m *Document) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*Document) XXX_Merge

func (m *Document) XXX_Merge(src proto.Message)

func (*Document) XXX_Size

func (m *Document) XXX_Size() int

func (*Document) XXX_Unmarshal

func (m *Document) XXX_Unmarshal(b []byte) error

type Document_DocumentMeta

type Document_DocumentMeta struct {
	Name                 string                            `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"`
	Mime                 string                            `protobuf:"bytes,2,opt,name=mime,proto3" json:"mime,omitempty"`
	Format               Document_DocumentMeta_InputFormat `protobuf:"varint,3,opt,name=format,proto3,enum=commonform.Document_DocumentMeta_InputFormat" json:"format,omitempty"`
	XXX_NoUnkeyedLiteral struct{}                          `json:"-"`
	XXX_unrecognized     []byte                            `json:"-"`
	XXX_sizecache        int32                             `json:"-"`
}

func (*Document_DocumentMeta) Descriptor

func (*Document_DocumentMeta) Descriptor() ([]byte, []int)

func (*Document_DocumentMeta) GetFormat

func (*Document_DocumentMeta) GetMime

func (m *Document_DocumentMeta) GetMime() string

func (*Document_DocumentMeta) GetName

func (m *Document_DocumentMeta) GetName() string

func (*Document_DocumentMeta) ProtoMessage

func (*Document_DocumentMeta) ProtoMessage()

func (*Document_DocumentMeta) Reset

func (m *Document_DocumentMeta) Reset()

func (*Document_DocumentMeta) String

func (m *Document_DocumentMeta) String() string

func (*Document_DocumentMeta) XXX_DiscardUnknown

func (m *Document_DocumentMeta) XXX_DiscardUnknown()

func (*Document_DocumentMeta) XXX_Marshal

func (m *Document_DocumentMeta) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*Document_DocumentMeta) XXX_Merge

func (m *Document_DocumentMeta) XXX_Merge(src proto.Message)

func (*Document_DocumentMeta) XXX_Size

func (m *Document_DocumentMeta) XXX_Size() int

func (*Document_DocumentMeta) XXX_Unmarshal

func (m *Document_DocumentMeta) XXX_Unmarshal(b []byte) error

type Document_DocumentMeta_InputFormat

type Document_DocumentMeta_InputFormat int32
const (
	Document_DocumentMeta_commonmark Document_DocumentMeta_InputFormat = 0
	Document_DocumentMeta_json       Document_DocumentMeta_InputFormat = 1
	Document_DocumentMeta_markup     Document_DocumentMeta_InputFormat = 2
)

func (Document_DocumentMeta_InputFormat) EnumDescriptor

func (Document_DocumentMeta_InputFormat) EnumDescriptor() ([]byte, []int)

func (Document_DocumentMeta_InputFormat) String

type ToAssemble

type ToAssemble struct {
	Document   *Document               `protobuf:"bytes,1,opt,name=document,proto3" json:"document,omitempty"`
	Title      string                  `protobuf:"bytes,2,opt,name=title,proto3" json:"title,omitempty"`
	Blanks     []*ToAssemble_Blank     `protobuf:"bytes,3,rep,name=blanks,proto3" json:"blanks,omitempty"`
	Signatures []*ToAssemble_Signature `protobuf:"bytes,4,rep,name=signatures,proto3" json:"signatures,omitempty"`
	// really the below should be a formalized object,
	// but protobuf cannot cope with the mixed output
	// it would require since it is really a
	// map<string, (string|bool)> . as such, until
	// we systematize the sytles object or protobuf
	// changes it's type guarantees we just send the
	// json bytes in and allow the server to Marshal
	// them into a json object the server can read.
	Styles                 []byte                  `protobuf:"bytes,5,opt,name=styles,proto3" json:"styles,omitempty"`
	Format                 ToAssemble_OutputFormat `protobuf:"varint,6,opt,name=format,proto3,enum=commonform.ToAssemble_OutputFormat" json:"format,omitempty"`
	Numbering              ToAssemble_NumberFormat `protobuf:"varint,7,opt,name=numbering,proto3,enum=commonform.ToAssemble_NumberFormat" json:"numbering,omitempty"`
	Hash                   bool                    `protobuf:"varint,8,opt,name=hash,proto3" json:"hash,omitempty"`
	IndentMargins          bool                    `protobuf:"varint,9,opt,name=indentMargins,proto3" json:"indentMargins,omitempty"`
	LeftAlignTitle         bool                    `protobuf:"varint,10,opt,name=leftAlignTitle,proto3" json:"leftAlignTitle,omitempty"`
	MarkFilled             bool                    `protobuf:"varint,11,opt,name=markFilled,proto3" json:"markFilled,omitempty"`
	UnfilledBlanks         string                  `protobuf:"bytes,12,opt,name=unfilledBlanks,proto3" json:"unfilledBlanks,omitempty"`
	UseExternalSignatures  bool                    `protobuf:"varint,13,opt,name=useExternalSignatures,proto3" json:"useExternalSignatures,omitempty"`
	ExternalSignatureCount uint64                  `protobuf:"varint,14,opt,name=externalSignatureCount,proto3" json:"externalSignatureCount,omitempty"`
	XXX_NoUnkeyedLiteral   struct{}                `json:"-"`
	XXX_unrecognized       []byte                  `json:"-"`
	XXX_sizecache          int32                   `json:"-"`
}

The ToAssemble message is fairly complex due to the structure of the information which commonform expects us to send it.

Many of the nobs that can be turned within the commonform server have reasonable defaults given BOTH within the server/engine itself and within the ToAssemble message. As such, many of the below feilds are optional (or repeated, which assumes optional in protobuf parlance).

func (*ToAssemble) Descriptor

func (*ToAssemble) Descriptor() ([]byte, []int)

func (*ToAssemble) GetBlanks

func (m *ToAssemble) GetBlanks() []*ToAssemble_Blank

func (*ToAssemble) GetDocument

func (m *ToAssemble) GetDocument() *Document

func (*ToAssemble) GetExternalSignatureCount

func (m *ToAssemble) GetExternalSignatureCount() uint64

func (*ToAssemble) GetFormat

func (m *ToAssemble) GetFormat() ToAssemble_OutputFormat

func (*ToAssemble) GetHash

func (m *ToAssemble) GetHash() bool

func (*ToAssemble) GetIndentMargins

func (m *ToAssemble) GetIndentMargins() bool

func (*ToAssemble) GetLeftAlignTitle

func (m *ToAssemble) GetLeftAlignTitle() bool

func (*ToAssemble) GetMarkFilled

func (m *ToAssemble) GetMarkFilled() bool

func (*ToAssemble) GetNumbering

func (m *ToAssemble) GetNumbering() ToAssemble_NumberFormat

func (*ToAssemble) GetSignatures

func (m *ToAssemble) GetSignatures() []*ToAssemble_Signature

func (*ToAssemble) GetStyles

func (m *ToAssemble) GetStyles() []byte

func (*ToAssemble) GetTitle

func (m *ToAssemble) GetTitle() string

func (*ToAssemble) GetUnfilledBlanks

func (m *ToAssemble) GetUnfilledBlanks() string

func (*ToAssemble) GetUseExternalSignatures

func (m *ToAssemble) GetUseExternalSignatures() bool

func (*ToAssemble) ProtoMessage

func (*ToAssemble) ProtoMessage()

func (*ToAssemble) Reset

func (m *ToAssemble) Reset()

func (*ToAssemble) String

func (m *ToAssemble) String() string

func (*ToAssemble) XXX_DiscardUnknown

func (m *ToAssemble) XXX_DiscardUnknown()

func (*ToAssemble) XXX_Marshal

func (m *ToAssemble) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*ToAssemble) XXX_Merge

func (m *ToAssemble) XXX_Merge(src proto.Message)

func (*ToAssemble) XXX_Size

func (m *ToAssemble) XXX_Size() int

func (*ToAssemble) XXX_Unmarshal

func (m *ToAssemble) XXX_Unmarshal(b []byte) error

type ToAssemble_Blank

type ToAssemble_Blank struct {
	Name                 string   `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"`
	Value                string   `protobuf:"bytes,2,opt,name=value,proto3" json:"value,omitempty"`
	XXX_NoUnkeyedLiteral struct{} `json:"-"`
	XXX_unrecognized     []byte   `json:"-"`
	XXX_sizecache        int32    `json:"-"`
}

we use a formalized object to enhance type safety

func (*ToAssemble_Blank) Descriptor

func (*ToAssemble_Blank) Descriptor() ([]byte, []int)

func (*ToAssemble_Blank) GetName

func (m *ToAssemble_Blank) GetName() string

func (*ToAssemble_Blank) GetValue

func (m *ToAssemble_Blank) GetValue() string

func (*ToAssemble_Blank) ProtoMessage

func (*ToAssemble_Blank) ProtoMessage()

func (*ToAssemble_Blank) Reset

func (m *ToAssemble_Blank) Reset()

func (*ToAssemble_Blank) String

func (m *ToAssemble_Blank) String() string

func (*ToAssemble_Blank) XXX_DiscardUnknown

func (m *ToAssemble_Blank) XXX_DiscardUnknown()

func (*ToAssemble_Blank) XXX_Marshal

func (m *ToAssemble_Blank) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*ToAssemble_Blank) XXX_Merge

func (m *ToAssemble_Blank) XXX_Merge(src proto.Message)

func (*ToAssemble_Blank) XXX_Size

func (m *ToAssemble_Blank) XXX_Size() int

func (*ToAssemble_Blank) XXX_Unmarshal

func (m *ToAssemble_Blank) XXX_Unmarshal(b []byte) error

type ToAssemble_NumberFormat

type ToAssemble_NumberFormat int32

the below are options but we should be largely opinionated for most uses.

const (
	ToAssemble_decimal ToAssemble_NumberFormat = 0
	ToAssemble_outline ToAssemble_NumberFormat = 1
)

func (ToAssemble_NumberFormat) EnumDescriptor

func (ToAssemble_NumberFormat) EnumDescriptor() ([]byte, []int)

func (ToAssemble_NumberFormat) String

func (x ToAssemble_NumberFormat) String() string

type ToAssemble_OutputFormat

type ToAssemble_OutputFormat int32

we use an enum both for type safety as well as to signal what has been implemented in the server.

const (
	ToAssemble_docx     ToAssemble_OutputFormat = 0
	ToAssemble_html     ToAssemble_OutputFormat = 1
	ToAssemble_html5    ToAssemble_OutputFormat = 2
	ToAssemble_markdown ToAssemble_OutputFormat = 3
)

func (ToAssemble_OutputFormat) EnumDescriptor

func (ToAssemble_OutputFormat) EnumDescriptor() ([]byte, []int)

func (ToAssemble_OutputFormat) String

func (x ToAssemble_OutputFormat) String() string

type ToAssemble_Signature

type ToAssemble_Signature struct {
	Term                 string                         `protobuf:"bytes,1,opt,name=term,proto3" json:"term,omitempty"`
	Name                 string                         `protobuf:"bytes,2,opt,name=name,proto3" json:"name,omitempty"`
	Header               string                         `protobuf:"bytes,3,opt,name=header,proto3" json:"header,omitempty"`
	Information          []string                       `protobuf:"bytes,4,rep,name=information,proto3" json:"information,omitempty"`
	SamePage             bool                           `protobuf:"varint,5,opt,name=samePage,proto3" json:"samePage,omitempty"`
	Entities             []*ToAssemble_Signature_Entity `protobuf:"bytes,6,rep,name=entities,proto3" json:"entities,omitempty"`
	XXX_NoUnkeyedLiteral struct{}                       `json:"-"`
	XXX_unrecognized     []byte                         `json:"-"`
	XXX_sizecache        int32                          `json:"-"`
}

we use a formalized object to enhance type safety

func (*ToAssemble_Signature) Descriptor

func (*ToAssemble_Signature) Descriptor() ([]byte, []int)

func (*ToAssemble_Signature) GetEntities

func (*ToAssemble_Signature) GetHeader

func (m *ToAssemble_Signature) GetHeader() string

func (*ToAssemble_Signature) GetInformation

func (m *ToAssemble_Signature) GetInformation() []string

func (*ToAssemble_Signature) GetName

func (m *ToAssemble_Signature) GetName() string

func (*ToAssemble_Signature) GetSamePage

func (m *ToAssemble_Signature) GetSamePage() bool

func (*ToAssemble_Signature) GetTerm

func (m *ToAssemble_Signature) GetTerm() string

func (*ToAssemble_Signature) ProtoMessage

func (*ToAssemble_Signature) ProtoMessage()

func (*ToAssemble_Signature) Reset

func (m *ToAssemble_Signature) Reset()

func (*ToAssemble_Signature) String

func (m *ToAssemble_Signature) String() string

func (*ToAssemble_Signature) XXX_DiscardUnknown

func (m *ToAssemble_Signature) XXX_DiscardUnknown()

func (*ToAssemble_Signature) XXX_Marshal

func (m *ToAssemble_Signature) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*ToAssemble_Signature) XXX_Merge

func (m *ToAssemble_Signature) XXX_Merge(src proto.Message)

func (*ToAssemble_Signature) XXX_Size

func (m *ToAssemble_Signature) XXX_Size() int

func (*ToAssemble_Signature) XXX_Unmarshal

func (m *ToAssemble_Signature) XXX_Unmarshal(b []byte) error

type ToAssemble_Signature_Entity

type ToAssemble_Signature_Entity struct {
	Name                 string   `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"`
	Form                 string   `protobuf:"bytes,2,opt,name=form,proto3" json:"form,omitempty"`
	Jurisdiction         string   `protobuf:"bytes,3,opt,name=jurisdiction,proto3" json:"jurisdiction,omitempty"`
	By                   string   `protobuf:"bytes,4,opt,name=by,proto3" json:"by,omitempty"`
	XXX_NoUnkeyedLiteral struct{} `json:"-"`
	XXX_unrecognized     []byte   `json:"-"`
	XXX_sizecache        int32    `json:"-"`
}

func (*ToAssemble_Signature_Entity) Descriptor

func (*ToAssemble_Signature_Entity) Descriptor() ([]byte, []int)

func (*ToAssemble_Signature_Entity) GetBy

func (*ToAssemble_Signature_Entity) GetForm

func (m *ToAssemble_Signature_Entity) GetForm() string

func (*ToAssemble_Signature_Entity) GetJurisdiction

func (m *ToAssemble_Signature_Entity) GetJurisdiction() string

func (*ToAssemble_Signature_Entity) GetName

func (m *ToAssemble_Signature_Entity) GetName() string

func (*ToAssemble_Signature_Entity) ProtoMessage

func (*ToAssemble_Signature_Entity) ProtoMessage()

func (*ToAssemble_Signature_Entity) Reset

func (m *ToAssemble_Signature_Entity) Reset()

func (*ToAssemble_Signature_Entity) String

func (m *ToAssemble_Signature_Entity) String() string

func (*ToAssemble_Signature_Entity) XXX_DiscardUnknown

func (m *ToAssemble_Signature_Entity) XXX_DiscardUnknown()

func (*ToAssemble_Signature_Entity) XXX_Marshal

func (m *ToAssemble_Signature_Entity) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*ToAssemble_Signature_Entity) XXX_Merge

func (m *ToAssemble_Signature_Entity) XXX_Merge(src proto.Message)

func (*ToAssemble_Signature_Entity) XXX_Size

func (m *ToAssemble_Signature_Entity) XXX_Size() int

func (*ToAssemble_Signature_Entity) XXX_Unmarshal

func (m *ToAssemble_Signature_Entity) XXX_Unmarshal(b []byte) error

type UnimplementedCommonFormEngineServer

type UnimplementedCommonFormEngineServer struct {
}

UnimplementedCommonFormEngineServer can be embedded to have forward compatible implementations.

func (*UnimplementedCommonFormEngineServer) Assemble

func (*UnimplementedCommonFormEngineServer) Extract

Jump to

Keyboard shortcuts

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