goff

package module
v1.0.17 Latest Latest
Warning

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

Go to latest
Published: Mar 2, 2020 License: Apache-2.0 Imports: 4 Imported by: 8

README

Using protobuf-v3

Protobuf v3 comes with pretty nice definition that normally used for GRPC, including

  • Solid data types
  • Quite known pre-defined format
  • Service definition ready
  • We can utilize stream operation to define events

Current state

  • Define structure
  • Code skeleton for protobuf generator
  • Define golang implementation
  • Define typescript implementation
  • Tests
  • Incorporate tracing and monitoring into the implementations

How to run

  • Go installed
  • Make sure probuffer installed (can install using brew install protobuf)
  • Confirm the installation by having protoc in code
  • Execute generate.sh from root dir (can also use go generate todo ...)

Text below are deprecated

How to use current repo

We utilize gomplate to generate file. The repo is still at its very early stage

  • Install gomplate using npm or go get
  • Use gomplate -d todo_v2.yaml -f go.tmp to kick start

It looks like this at the moment

type Todo struct {
    TodoText string
    TodoId string
}
type TodoId string
type TodoText string


type TodoBFF interface {
    func AddTodo map[request:[todo_text]]
    func GetTodos map[response:map[body:todo type:array]]
    func RemoveTodo map[request:[todo_id]]
}

Documentation

Index

Constants

This section is empty.

Variables

View Source
var E_Custom = &proto.ExtensionDesc{
	ExtendedType:  (*descriptor.FieldOptions)(nil),
	ExtensionType: (*string)(nil),
	Field:         51242,
	Name:          "goff.custom",
	Tag:           "bytes,51242,opt,name=custom",
	Filename:      "ares/proto/goff.proto",
}
View Source
var E_NatsQueue = &proto.ExtensionDesc{
	ExtendedType:  (*descriptor.FileOptions)(nil),
	ExtensionType: (*string)(nil),
	Field:         51237,
	Name:          "goff.nats_queue",
	Tag:           "bytes,51237,opt,name=nats_queue",
	Filename:      "ares/proto/goff.proto",
}
View Source
var E_NatsSubject = &proto.ExtensionDesc{
	ExtendedType:  (*descriptor.FileOptions)(nil),
	ExtensionType: (*string)(nil),
	Field:         51236,
	Name:          "goff.nats_subject",
	Tag:           "bytes,51236,opt,name=nats_subject",
	Filename:      "ares/proto/goff.proto",
}
View Source
var E_Nullable = &proto.ExtensionDesc{
	ExtendedType:  (*descriptor.FieldOptions)(nil),
	ExtensionType: (*bool)(nil),
	Field:         51243,
	Name:          "goff.nullable",
	Tag:           "varint,51243,opt,name=nullable",
	Filename:      "ares/proto/goff.proto",
}
View Source
var E_ResponseEvent = &proto.ExtensionDesc{
	ExtendedType:  (*descriptor.MethodOptions)(nil),
	ExtensionType: (*string)(nil),
	Field:         51238,
	Name:          "goff.response_event",
	Tag:           "bytes,51238,opt,name=response_event",
	Filename:      "ares/proto/goff.proto",
}
View Source
var E_Secured = &proto.ExtensionDesc{
	ExtendedType:  (*descriptor.MethodOptions)(nil),
	ExtensionType: (*string)(nil),
	Field:         51239,
	Name:          "goff.secured",
	Tag:           "bytes,51239,opt,name=secured",
	Filename:      "ares/proto/goff.proto",
}
View Source
var E_Test = &proto.ExtensionDesc{
	ExtendedType:  (*descriptor.MethodOptions)(nil),
	ExtensionType: (*Kaka)(nil),
	Field:         51256,
	Name:          "goff.test",
	Tag:           "bytes,51256,opt,name=test",
	Filename:      "ares/proto/goff.proto",
}
View Source
var SecurityRole_name = map[int32]string{
	0: "SYS_ADMIN",
	1: "CARE_PROVIDER_ADMIN",
	2: "CARE_PROVIDER_MEMBER",
	3: "CARE_PROVIDER_MEMBER_PRE_SWITCH",
	4: "PATIENT",
	5: "PATIENT_PRE_SWITCH",
}
View Source
var SecurityRole_value = map[string]int32{
	"SYS_ADMIN":                       0,
	"CARE_PROVIDER_ADMIN":             1,
	"CARE_PROVIDER_MEMBER":            2,
	"CARE_PROVIDER_MEMBER_PRE_SWITCH": 3,
	"PATIENT":                         4,
	"PATIENT_PRE_SWITCH":              5,
}
View Source
var SecurityRule_name = map[int32]string{
	0: "IS_AUTHENTICATED",
	1: "IS_ANONYMOUS",
	2: "DENY_ALL",
}
View Source
var SecurityRule_value = map[string]int32{
	"IS_AUTHENTICATED": 0,
	"IS_ANONYMOUS":     1,
	"DENY_ALL":         2,
}

Functions

This section is empty.

Types

type Empty

type Empty struct {
	XXX_NoUnkeyedLiteral struct{} `json:"-"`
	XXX_unrecognized     []byte   `json:"-"`
	XXX_sizecache        int32    `json:"-"`
}

func (*Empty) Descriptor

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

func (*Empty) ProtoMessage

func (*Empty) ProtoMessage()

func (*Empty) Reset

func (m *Empty) Reset()

func (*Empty) String

func (m *Empty) String() string

func (*Empty) XXX_DiscardUnknown

func (m *Empty) XXX_DiscardUnknown()

func (*Empty) XXX_Marshal

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

func (*Empty) XXX_Merge

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

func (*Empty) XXX_Size

func (m *Empty) XXX_Size() int

func (*Empty) XXX_Unmarshal

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

type Kaka added in v1.0.1

type Kaka struct {
	Kaka1                string   `protobuf:"bytes,1,opt,name=Kaka1,proto3" json:"Kaka1,omitempty"`
	Kaka2                string   `protobuf:"bytes,2,opt,name=Kaka2,proto3" json:"Kaka2,omitempty"`
	Kaka3                string   `protobuf:"bytes,3,opt,name=Kaka3,proto3" json:"Kaka3,omitempty"`
	Kaka4                string   `protobuf:"bytes,4,opt,name=Kaka4,proto3" json:"Kaka4,omitempty"`
	Kaka5                string   `protobuf:"bytes,5,opt,name=Kaka5,proto3" json:"Kaka5,omitempty"`
	XXX_NoUnkeyedLiteral struct{} `json:"-"`
	XXX_unrecognized     []byte   `json:"-"`
	XXX_sizecache        int32    `json:"-"`
}

func (*Kaka) Descriptor added in v1.0.1

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

func (*Kaka) GetKaka1 added in v1.0.1

func (m *Kaka) GetKaka1() string

func (*Kaka) GetKaka2 added in v1.0.1

func (m *Kaka) GetKaka2() string

func (*Kaka) GetKaka3 added in v1.0.1

func (m *Kaka) GetKaka3() string

func (*Kaka) GetKaka4 added in v1.0.1

func (m *Kaka) GetKaka4() string

func (*Kaka) GetKaka5 added in v1.0.1

func (m *Kaka) GetKaka5() string

func (*Kaka) ProtoMessage added in v1.0.1

func (*Kaka) ProtoMessage()

func (*Kaka) Reset added in v1.0.1

func (m *Kaka) Reset()

func (*Kaka) String added in v1.0.1

func (m *Kaka) String() string

func (*Kaka) XXX_DiscardUnknown added in v1.0.1

func (m *Kaka) XXX_DiscardUnknown()

func (*Kaka) XXX_Marshal added in v1.0.1

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

func (*Kaka) XXX_Merge added in v1.0.1

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

func (*Kaka) XXX_Size added in v1.0.1

func (m *Kaka) XXX_Size() int

func (*Kaka) XXX_Unmarshal added in v1.0.1

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

type SecurityRole added in v1.0.1

type SecurityRole int32
const (
	SecurityRole_SYS_ADMIN                       SecurityRole = 0
	SecurityRole_CARE_PROVIDER_ADMIN             SecurityRole = 1
	SecurityRole_CARE_PROVIDER_MEMBER            SecurityRole = 2
	SecurityRole_CARE_PROVIDER_MEMBER_PRE_SWITCH SecurityRole = 3
	SecurityRole_PATIENT                         SecurityRole = 4
	SecurityRole_PATIENT_PRE_SWITCH              SecurityRole = 5
)

func (SecurityRole) EnumDescriptor added in v1.0.1

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

func (SecurityRole) String added in v1.0.1

func (x SecurityRole) String() string

type SecurityRule added in v1.0.1

type SecurityRule int32
const (
	SecurityRule_IS_AUTHENTICATED SecurityRule = 0
	SecurityRule_IS_ANONYMOUS     SecurityRule = 1
	SecurityRule_DENY_ALL         SecurityRule = 2
)

func (SecurityRule) EnumDescriptor added in v1.0.1

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

func (SecurityRule) String added in v1.0.1

func (x SecurityRule) String() string

type UUID

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

func (*UUID) Descriptor

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

func (*UUID) GetValue

func (m *UUID) GetValue() string

func (*UUID) ProtoMessage

func (*UUID) ProtoMessage()

func (*UUID) Reset

func (m *UUID) Reset()

func (*UUID) String

func (m *UUID) String() string

func (*UUID) XXX_DiscardUnknown

func (m *UUID) XXX_DiscardUnknown()

func (*UUID) XXX_Marshal

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

func (*UUID) XXX_Merge

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

func (*UUID) XXX_Size

func (m *UUID) XXX_Size() int

func (*UUID) XXX_Unmarshal

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

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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