cmd

package
v0.0.0-...-cfc79c9 Latest Latest
Warning

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

Go to latest
Published: Sep 4, 2020 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Overview

Copyright © 2020 Kamga Stephane <kamga.stephane@gmail.com>

Licensed 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.

Copyright © 2020 NAME HERE kamga.stephane@gmail.com

Licensed 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

This section is empty.

Variables

This section is empty.

Functions

func Execute

func Execute()

Execute adds all child commands to the root command and sets flags appropriately. This is called by main.main(). It only needs to happen once to the rootCmd.

Types

type Context

type Context struct {
	BaseUrl       string
	Env           string
	ApplicationId string
	ProjectId     string
}

type DequeuePayload

type DequeuePayload struct {
	CommandId string `json:"bootstrapCommandId"`
	Async     bool   `json:"async"`
}

type DequeueResponse

type DequeueResponse struct {
	ResponseStatus ResponseStatus `json:"ResponseStatus"`
}

type EnqueueResponse

type EnqueueResponse struct {
	EntityCount int    `json:"commandsEnqueued"`
	CommandId   string `json:"bootstrapCommandId"`
}

type Meta

type Meta struct {
	OperationId string `json:"operationId"`
}

type ResourceContracts

type ResourceContracts struct {
	Name            string      `json:"name"`
	ResourceClassId int         `json:"resourceClassId"`
	Properties      interface{} `json:"properties"`
}

type ResponseStatus

type ResponseStatus struct {
	Meta Meta `json:"meta"`
}

type Service

type Service struct {
	Url           string
	ApplicationId string
	ProjectId     string
}

func NewService

func NewService(ctx Context) *Service

func (*Service) CreateTask

func (s *Service) CreateTask(queue string, resourceClassId string, resourceId string) (*EnqueueResponse, error)

func (*Service) Dequeue

func (s *Service) Dequeue(commandId string) (*DequeueResponse, error)

func (*Service) Find

func (s *Service) Find(entityName string) ([]ResourceContracts, error)

func (*Service) Status

func (s *Service) Status(commandId string) (*StatusResponse, error)

type StatusResponse

type StatusResponse struct {
	RemainingMessagesSent int `json:"remainingMessagesToBeSent"`
	FailedMessages        int `json:"failedMessages"`
}

Jump to

Keyboard shortcuts

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