cmd

package
v1.0.6 Latest Latest
Warning

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

Go to latest
Published: Nov 13, 2019 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Overview

Copyright © 2019 Nickolay Kuropatkin nictaporuk@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 © 2019 NNickolay Kuropatkin nictaporuk@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 © 2019 Nickolay Kuropatkin nictaporuk@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 © 2019 NAME HERE <EMAIL ADDRESS>

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 © 2019 Nickolay Kuropatkin nictaporuk@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 © 2019 Nickolay Kuropatkin nictaporuk@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 © 2019 Nikolay Kuropatkin nictaporuk@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 © 2019 NAME HERE <EMAIL ADDRESS>

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 © 2019 Nickolay Kuropatkin nictaporuk@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

View Source
const (
	BookingCommandName = "booking"
)
View Source
const (
	ChannelBindingCommandName = "channelBinding"
)
View Source
const (
	HoldCommandName = "hold"
)
View Source
const (
	ProductCommandName = "product"
)
View Source
const (
	RateCommandName = "rate"
)
View Source
const (
	SupplierCommandName = "supplier"
)

Variables

View Source
var (
	RootCmd = cobra.Command{
		Use:          "channels_booking_clients",
		Short:        "channel booking generator",
		Long:         "channel booking generator",
		SilenceUsage: true,
	}

	Version string
	Commit  string
	Date    string
)
View Source
var (
	ErrorBookingFileIsNotFound = errors.New("booking.json file was not found by path")
)
View Source
var (
	ErrorChannelBindingFileIsNotFound = errors.New("channelBinding.json file was not found by path")
)
View Source
var (
	ErrorHoldFileIsNotFound = errors.New("hold.json file was not found by path")
)
View Source
var (
	ErrorProductFileIsNotFound = errors.New("product.json file was not found by path")
)
View Source
var (
	ErrorRateFileIsNotFound = errors.New("rate.json file was not found by path")
)
View Source
var (
	ErrorStopAfterEntityIsUnknown = errors.New("value of stopAfterEntity is unknown")
)
View Source
var (
	ErrorSupplierFileIsNotFound = errors.New("supplier.json file was not found by path")
)
View Source
var RunCmd = &cobra.Command{
	Use:   "run",
	Short: "command of run use for generate all needing entities",
	Long:  `command of run use for generate all needing entities`,
	Run: func(cmd *cobra.Command, args []string) {
		run()
	},
}

runCmd represents the run command

Functions

func Execute

func Execute(version, commit, date string)

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.

func ValidateStopAfterEntity

func ValidateStopAfterEntity(stopAfterEntity string) error

ValidateStopAfterEntity validate value of configuration field stopAfterEntity

Types

type BookingRepository

type BookingRepository struct {
	// contains filtered or unexported fields
}

BookingRepository

func NewBookingRepository

func NewBookingRepository(client *booking.BookingClient, channelClient *channels.ChannelsClient, ctx *context.Context, logger *logger.LocalLogger, configuration *config.Configuration) *BookingRepository

func (*BookingRepository) ChannelClient

func (s *BookingRepository) ChannelClient() *channels.ChannelsClient

func (*BookingRepository) Client

func (*BookingRepository) Configuration

func (s *BookingRepository) Configuration() *config.Configuration

func (*BookingRepository) Ctx

func (s *BookingRepository) Ctx() *context.Context

func (*BookingRepository) Execute

func (s *BookingRepository) Execute() error

Execute represents the supplier command

func (*BookingRepository) Logger

func (s *BookingRepository) Logger() *logger.LocalLogger

func (*BookingRepository) Name

func (s *BookingRepository) Name() string

func (*BookingRepository) SetChannelClient

func (s *BookingRepository) SetChannelClient(channelClient *channels.ChannelsClient)

func (*BookingRepository) SetClient

func (s *BookingRepository) SetClient(client *booking.BookingClient)

func (*BookingRepository) SetConfiguration

func (s *BookingRepository) SetConfiguration(configuration *config.Configuration)

func (*BookingRepository) SetCtx

func (s *BookingRepository) SetCtx(ctx *context.Context)

func (*BookingRepository) SetLogger

func (s *BookingRepository) SetLogger(logger *logger.LocalLogger)

type ChannelBindingRepository

type ChannelBindingRepository struct {
	// contains filtered or unexported fields
}

ChannelBindingRepository

func NewChannelBindingRepository

func NewChannelBindingRepository(client *channels.ChannelsClient, ctx *context.Context, logger *logger.LocalLogger, configuration *config.Configuration) *ChannelBindingRepository

func (*ChannelBindingRepository) Client

func (*ChannelBindingRepository) Configuration

func (s *ChannelBindingRepository) Configuration() *config.Configuration

func (*ChannelBindingRepository) Ctx

func (*ChannelBindingRepository) Execute

func (s *ChannelBindingRepository) Execute() error

Execute represents the supplier command

func (*ChannelBindingRepository) Logger

func (*ChannelBindingRepository) Name

func (s *ChannelBindingRepository) Name() string

func (*ChannelBindingRepository) SetClient

func (s *ChannelBindingRepository) SetClient(client *channels.ChannelsClient)

func (*ChannelBindingRepository) SetConfiguration

func (s *ChannelBindingRepository) SetConfiguration(configuration *config.Configuration)

func (*ChannelBindingRepository) SetCtx

func (s *ChannelBindingRepository) SetCtx(ctx *context.Context)

func (*ChannelBindingRepository) SetLogger

func (s *ChannelBindingRepository) SetLogger(logger *logger.LocalLogger)

type EntityRepository

type EntityRepository interface {
	Execute() error
	Name() string
	Configuration() *config.Configuration
	Logger() *logger.LocalLogger
}

EntityRepository is interface of repositories

type HoldRepository

type HoldRepository struct {
	// contains filtered or unexported fields
}

HoldRepository

func NewHoldRepository

func NewHoldRepository(client *booking.BookingClient, channelClient *channels.ChannelsClient, ctx *context.Context, logger *logger.LocalLogger, configuration *config.Configuration) *HoldRepository

func (*HoldRepository) ChannelsClient

func (s *HoldRepository) ChannelsClient() *channels.ChannelsClient

func (*HoldRepository) Client

func (s *HoldRepository) Client() *booking.BookingClient

func (*HoldRepository) Configuration

func (s *HoldRepository) Configuration() *config.Configuration

func (*HoldRepository) Ctx

func (s *HoldRepository) Ctx() *context.Context

func (*HoldRepository) Execute

func (s *HoldRepository) Execute() error

Execute represents the supplier command

func (*HoldRepository) Logger

func (s *HoldRepository) Logger() *logger.LocalLogger

func (*HoldRepository) Name

func (s *HoldRepository) Name() string

func (*HoldRepository) SetChannelsClient

func (s *HoldRepository) SetChannelsClient(channelClient *channels.ChannelsClient)

func (*HoldRepository) SetClient

func (s *HoldRepository) SetClient(client *booking.BookingClient)

func (*HoldRepository) SetConfiguration

func (s *HoldRepository) SetConfiguration(configuration *config.Configuration)

func (*HoldRepository) SetCtx

func (s *HoldRepository) SetCtx(ctx *context.Context)

func (*HoldRepository) SetLogger

func (s *HoldRepository) SetLogger(logger *logger.LocalLogger)

type ProductRepository

type ProductRepository struct {
	// contains filtered or unexported fields
}

ProductRepository

func NewProductRepository

func NewProductRepository(client *channels.ChannelsClient, ctx *context.Context, logger *logger.LocalLogger, configuration *config.Configuration) *ProductRepository

func (*ProductRepository) Client

func (*ProductRepository) Configuration

func (p *ProductRepository) Configuration() *config.Configuration

func (*ProductRepository) Ctx

func (p *ProductRepository) Ctx() *context.Context

func (*ProductRepository) Execute

func (p *ProductRepository) Execute() error

Execute represents the supplier command

func (*ProductRepository) Logger

func (p *ProductRepository) Logger() *logger.LocalLogger

func (*ProductRepository) Name

func (p *ProductRepository) Name() string

func (*ProductRepository) SetClient

func (p *ProductRepository) SetClient(client *channels.ChannelsClient)

func (*ProductRepository) SetConfiguration

func (p *ProductRepository) SetConfiguration(configuration *config.Configuration)

func (*ProductRepository) SetCtx

func (p *ProductRepository) SetCtx(ctx *context.Context)

func (*ProductRepository) SetLogger

func (p *ProductRepository) SetLogger(logger *logger.LocalLogger)

type RateRepository

type RateRepository struct {
	// contains filtered or unexported fields
}

RateRepository

func NewRateRepository

func NewRateRepository(client *channels.ChannelsClient, ctx *context.Context, logger *logger.LocalLogger, configuration *config.Configuration) *RateRepository

func (*RateRepository) Client

func (s *RateRepository) Client() *channels.ChannelsClient

func (*RateRepository) Configuration

func (s *RateRepository) Configuration() *config.Configuration

func (*RateRepository) Ctx

func (s *RateRepository) Ctx() *context.Context

func (*RateRepository) Execute

func (s *RateRepository) Execute() error

Execute represents the supplier command

func (*RateRepository) Logger

func (s *RateRepository) Logger() *logger.LocalLogger

func (*RateRepository) Name

func (s *RateRepository) Name() string

func (*RateRepository) SetClient

func (s *RateRepository) SetClient(client *channels.ChannelsClient)

func (*RateRepository) SetConfiguration

func (s *RateRepository) SetConfiguration(configuration *config.Configuration)

func (*RateRepository) SetCtx

func (s *RateRepository) SetCtx(ctx *context.Context)

func (*RateRepository) SetLogger

func (s *RateRepository) SetLogger(logger *logger.LocalLogger)

type SupplierRepository

type SupplierRepository struct {
	// contains filtered or unexported fields
}

SupplierRepository

func NewSupplierRepository

func NewSupplierRepository(client *channels.ChannelsClient, ctx *context.Context, logger *logger.LocalLogger, configuration *config.Configuration) *SupplierRepository

func (*SupplierRepository) Client

func (*SupplierRepository) Configuration

func (s *SupplierRepository) Configuration() *config.Configuration

func (*SupplierRepository) Ctx

func (*SupplierRepository) Execute

func (s *SupplierRepository) Execute() error

Execute represents the supplier command

func (*SupplierRepository) Logger

func (s *SupplierRepository) Logger() *logger.LocalLogger

func (*SupplierRepository) Name

func (s *SupplierRepository) Name() string

func (*SupplierRepository) SetClient

func (s *SupplierRepository) SetClient(client *channels.ChannelsClient)

func (*SupplierRepository) SetConfiguration

func (s *SupplierRepository) SetConfiguration(configuration *config.Configuration)

func (*SupplierRepository) SetCtx

func (s *SupplierRepository) SetCtx(ctx *context.Context)

func (*SupplierRepository) SetLogger

func (s *SupplierRepository) SetLogger(logger *logger.LocalLogger)

Jump to

Keyboard shortcuts

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