Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 9 additions & 7 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -34,16 +34,18 @@ bench_race:
get-apidocs:
curl -o apidocs.json http://localhost:7300/apidocs

ADMIN_CLIENT_DIR := admin/client
FILES_TO_REMOVE := go.mod go.sum .travis.yml .openapi-generator-ignore git_push.sh .openapi-generator api test

gen-rest-client:
rm -r restclient
mkdir -p restclient
openapi-generator generate -i ./apidocs.json -g go -o restclient \
-rm -r $(ADMIN_CLIENT_DIR)
mkdir -p $(ADMIN_CLIENT_DIR)
openapi-generator generate -i ./apidocs.json -g go -o $(ADMIN_CLIENT_DIR) \
--git-user-id functionstream \
--git-repo-id functionstream/restclient \
--package-name restclient \
--git-repo-id functionstream/$(ADMIN_CLIENT_DIR) \
--package-name adminclient \
--global-property apiDocs,apis,models,supportingFiles
rm -r restclient/go.mod restclient/go.sum restclient/.travis.yml restclient/.openapi-generator-ignore \
restclient/git_push.sh restclient/.openapi-generator restclient/api restclient/test
rm -r $(addprefix $(ADMIN_CLIENT_DIR)/, $(FILES_TO_REMOVE))

proto:
for PROTO_FILE in $$(find . -name '*.proto'); do \
Expand Down
File renamed without changes.
18 changes: 9 additions & 9 deletions restclient/README.md → admin/client/README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Go API client for restclient
# Go API client for adminclient

Manage Function Stream Resources

Expand All @@ -22,7 +22,7 @@ go get golang.org/x/net/context
Put the package under your project folder and add the following in import:

```go
import restclient "github.com/functionstream/functionstream/restclient"
import adminclient "github.com/functionstream/functionstream/admin/client"
```

To use a proxy, set the environment variable `HTTP_PROXY`:
Expand All @@ -37,18 +37,18 @@ Default configuration comes with `Servers` field that contains server objects as

### Select Server Configuration

For using other server than the one defined on index 0 set context value `restclient.ContextServerIndex` of type `int`.
For using other server than the one defined on index 0 set context value `adminclient.ContextServerIndex` of type `int`.

```go
ctx := context.WithValue(context.Background(), restclient.ContextServerIndex, 1)
ctx := context.WithValue(context.Background(), adminclient.ContextServerIndex, 1)
```

### Templated Server URL

Templated server URL is formatted using default variables from configuration or from context value `restclient.ContextServerVariables` of type `map[string]string`.
Templated server URL is formatted using default variables from configuration or from context value `adminclient.ContextServerVariables` of type `map[string]string`.

```go
ctx := context.WithValue(context.Background(), restclient.ContextServerVariables, map[string]string{
ctx := context.WithValue(context.Background(), adminclient.ContextServerVariables, map[string]string{
"basePath": "v2",
})
```
Expand All @@ -59,13 +59,13 @@ Note, enum values are always validated and all unused variables are silently ign

Each operation can use different server URL defined using `OperationServers` map in the `Configuration`.
An operation is uniquely identified by `"{classname}Service.{nickname}"` string.
Similar rules for overriding default operation server index and variables applies by using `restclient.ContextOperationServerIndices` and `restclient.ContextOperationServerVariables` context maps.
Similar rules for overriding default operation server index and variables applies by using `adminclient.ContextOperationServerIndices` and `adminclient.ContextOperationServerVariables` context maps.

```go
ctx := context.WithValue(context.Background(), restclient.ContextOperationServerIndices, map[string]int{
ctx := context.WithValue(context.Background(), adminclient.ContextOperationServerIndices, map[string]int{
"{classname}Service.{nickname}": 2,
})
ctx = context.WithValue(context.Background(), restclient.ContextOperationServerVariables, map[string]map[string]string{
ctx = context.WithValue(context.Background(), adminclient.ContextOperationServerVariables, map[string]map[string]string{
"{classname}Service.{nickname}": {
"port": "8443",
},
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion restclient/api_state.go → admin/client/api_state.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion restclient/api_status.go → admin/client/api_status.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion restclient/api_tube.go → admin/client/api_tube.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion restclient/client.go → admin/client/client.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -5,19 +5,17 @@
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**Config** | Pointer to **map[string]string** | | [optional]
**Inputs** | **[]string** | |
**Name** | **string** | |
**Output** | **string** | |
**Replicas** | **int32** | |
**Runtime** | [**ModelRuntimeConfig**](ModelRuntimeConfig.md) | |
**Sink** | Pointer to [**ModelTubeConfig**](ModelTubeConfig.md) | | [optional]
**Source** | Pointer to [**ModelTubeConfig**](ModelTubeConfig.md) | | [optional]
**Source** | Pointer to [**[]ModelTubeConfig**](ModelTubeConfig.md) | | [optional]

## Methods

### NewModelFunction

`func NewModelFunction(inputs []string, name string, output string, replicas int32, runtime ModelRuntimeConfig, ) *ModelFunction`
`func NewModelFunction(name string, replicas int32, runtime ModelRuntimeConfig, ) *ModelFunction`

NewModelFunction instantiates a new ModelFunction object
This constructor will assign default values to properties that have it defined,
Expand Down Expand Up @@ -57,26 +55,6 @@ SetConfig sets Config field to given value.

HasConfig returns a boolean if a field has been set.

### GetInputs

`func (o *ModelFunction) GetInputs() []string`

GetInputs returns the Inputs field if non-nil, zero value otherwise.

### GetInputsOk

`func (o *ModelFunction) GetInputsOk() (*[]string, bool)`

GetInputsOk returns a tuple with the Inputs field if it's non-nil, zero value otherwise
and a boolean to check if the value has been set.

### SetInputs

`func (o *ModelFunction) SetInputs(v []string)`

SetInputs sets Inputs field to given value.


### GetName

`func (o *ModelFunction) GetName() string`
Expand All @@ -97,26 +75,6 @@ and a boolean to check if the value has been set.
SetName sets Name field to given value.


### GetOutput

`func (o *ModelFunction) GetOutput() string`

GetOutput returns the Output field if non-nil, zero value otherwise.

### GetOutputOk

`func (o *ModelFunction) GetOutputOk() (*string, bool)`

GetOutputOk returns a tuple with the Output field if it's non-nil, zero value otherwise
and a boolean to check if the value has been set.

### SetOutput

`func (o *ModelFunction) SetOutput(v string)`

SetOutput sets Output field to given value.


### GetReplicas

`func (o *ModelFunction) GetReplicas() int32`
Expand Down Expand Up @@ -184,20 +142,20 @@ HasSink returns a boolean if a field has been set.

### GetSource

`func (o *ModelFunction) GetSource() ModelTubeConfig`
`func (o *ModelFunction) GetSource() []ModelTubeConfig`

GetSource returns the Source field if non-nil, zero value otherwise.

### GetSourceOk

`func (o *ModelFunction) GetSourceOk() (*ModelTubeConfig, bool)`
`func (o *ModelFunction) GetSourceOk() (*[]ModelTubeConfig, bool)`

GetSourceOk returns a tuple with the Source field if it's non-nil, zero value otherwise
and a boolean to check if the value has been set.

### SetSource

`func (o *ModelFunction) SetSource(v ModelTubeConfig)`
`func (o *ModelFunction) SetSource(v []ModelTubeConfig)`

SetSource sets Source field to given value.

Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading