client

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Sep 17, 2022 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Overview

Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file distributed with this work for additional information regarding copyright ownership. The ASF licenses this file to you under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file distributed with this work for additional information regarding copyright ownership. The ASF licenses this file to you under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Index

Constants

View Source
const (
	DefaultNamespace = "_"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

type Client struct {
	Config    Config
	ApiClient *swagger.APIClient
	// contains filtered or unexported fields
}

func NewClient

func NewClient(httpClient *http.Client, config Config) (*Client, error)

NewClient creates a new funless client with the provided http client and configuration.

type Config

type Config struct {
	Host      string
	Namespace string
	BaseURL   *url.URL
}

type FnHandler

type FnHandler interface {
	Invoke(ctx context.Context, fnName string, fnNamespace string, fnArgs interface{}) (swagger.FunctionInvocationSuccess, error)
	Create(ctx context.Context, fnName string, fnNamespace string, code string, language string) (swagger.FunctionCreationSuccess, error)
	Delete(ctx context.Context, fnName string, fnNamespace string) (swagger.FunctionDeletionSuccess, error)
}

type FnService

type FnService struct {
	*Client
}

func (*FnService) Create

func (fn *FnService) Create(ctx context.Context, fnName string, fnNamespace string, code string, language string) (swagger.FunctionCreationSuccess, error)

func (*FnService) Delete

func (fn *FnService) Delete(ctx context.Context, fnName string, fnNamespace string) (swagger.FunctionDeletionSuccess, error)

func (*FnService) Invoke

func (fn *FnService) Invoke(ctx context.Context, fnName string, fnNamespace string, fnArgs interface{}) (swagger.FunctionInvocationSuccess, error)

Jump to

Keyboard shortcuts

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