-
Notifications
You must be signed in to change notification settings - Fork 132
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Adding language binding for golang #1483
base: main
Are you sure you want to change the base?
Conversation
✅ Deploy Preview for fdc3 canceled.
|
User ChannelType = "user" | ||
System ChannelType = "system" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Indentation
User ChannelType = "user" | |
System ChannelType = "system" | |
User ChannelType = "user" | |
System ChannelType = "system" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks like a great contribution @kemerava 👏
I've given it a quick pass for typos and indentation consistency, see comments.
I think we could do with a subsection adding here on Go: https://deploy-preview-1483--fdc3.netlify.app/docs/next/api/supported-platforms#native
Please describe any idiosyncracies specific to the language. If you intend to contribute a repo with the binding to FINOS it can also be mentioned there.
Id string `json:"id"` | ||
Type ChannelType `json:"type"` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Indentation
Id string `json:"id"` | |
Type ChannelType `json:"type"` | |
Id string `json:"id"` | |
Type ChannelType `json:"type"` |
|
||
```go | ||
func (ch *Channel) AddContextListener(contextType string, handler ContextHandler) <-chan Result[Listener] { | ||
// Implmentation here |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
// Implmentation here | |
// Implementation here |
// handle the contact | ||
}) | ||
listenerResultInstrument := <-channel.AddContextListener("fdc3.instrument", func(context Context, contextMetadata *ContextMetadata) { | ||
// handle the instrumnt |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
// handle the instrumnt | |
// handle the instrument |
|
||
```go | ||
func (channel *Channel) Broadcast(context Context) <-chan Result[any] { | ||
// Implmentation here |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
// Implmentation here | |
// Implementation here |
|
||
```go | ||
func (channel *Channel) GetCurrentContext(contextType string) <-chan Result[Context] { | ||
// Implmentation here |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
// Implmentation here | |
// Implementation here |
// The unique name of the intent that can be invoked by the raiseIntent call. | ||
Name string `json:"name"` | ||
|
||
DisplayName string `json:"displayName"` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Check indentation
|
||
```go | ||
type IntentResolution struct { | ||
// The application that resolved the intent. | ||
Source AppIdentifier `json:"source"` | ||
// The intent that was raised. | ||
Intent string `json:"intent"` | ||
// The version number of the Intents schema being used. | ||
Version string `json:"version"` | ||
} | ||
|
||
type IntentResult any | ||
|
||
func (ir *IntentResolution) GetResult() <-chan Result[IntentResult] { | ||
// implementation here | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Check indentation
resolutionResult := <-desktopAgent.RaiseIntent("QuoteStream", context, nil) | ||
if resolutionResult.Err != nil { | ||
// handle error | ||
} | ||
if channel, ok := resolutionResult.Value.(Channel); ok { | ||
log.Println("The result is a channel") | ||
} else if context, ok := resolutionResult.Value.(Context); ok { | ||
log.Println("The result is a context") | ||
} else { | ||
log.Error("The result is of incorrect data type!") | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
check indentation
// The unique application identifier located within a specific application directory instance. An example of an appId might be 'app@sub.root'. | ||
AppId string `json:"appId"` | ||
// An optional instance identifier, indicating that this object represents a specific instance of the application described. | ||
InstanceId string `json:"instanceId"` | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Check indentation
Type string `json:"type"` | ||
Name string `json:"name"` | ||
Id map[string]string `json:"id"` | ||
// This field is required only in golang, as golang structs cannot be extended with more fields later |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
check indentation
Describe your change
Adding golang language binding
@michael-bowen-sc
Related Issue
#1482
Contributor License Agreement
Review Checklist
DesktopAgent
,Channel
,PrivateChannel
,Listener
,Bridging
)?JSDoc comments on interfaces and types should be matched to the main documentation in /docs
Conformance test definitions should cover all required aspects of an FDC3 Desktop Agent implementation, which are usually marked with a MUST keyword, and optional features (SHOULD or MAY) where the format of those features is defined
The Web Connection protocol and Desktop Agent Communication Protocol schemas must be able to support all necessary aspects of the Desktop Agent API, while Bridging must support those aspects necessary for Desktop Agents to communicate with each other
npm run build
) run and the results checked in?Generated code will be found at
/src/api/BrowserTypes.ts
and/or/src/bridging/BridgingTypes.ts
BaseContext
schema applied viaallOf
(as it is in existing types)?title
anddescription
provided for all properties defined in the schema?npm run build
) run and the results checked in?Generated code will be found at
/src/context/ContextTypes.ts