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
- Variables
- func Execute(version, commit, date string)
- func ValidateStopAfterEntity(stopAfterEntity string) error
- type BookingRepository
- func (s *BookingRepository) ChannelClient() *channels.ChannelsClient
- func (s *BookingRepository) Client() *booking.BookingClient
- func (s *BookingRepository) Configuration() *config.Configuration
- func (s *BookingRepository) Ctx() *context.Context
- func (s *BookingRepository) Execute() error
- func (s *BookingRepository) Logger() *logger.LocalLogger
- func (s *BookingRepository) Name() string
- func (s *BookingRepository) SetChannelClient(channelClient *channels.ChannelsClient)
- func (s *BookingRepository) SetClient(client *booking.BookingClient)
- func (s *BookingRepository) SetConfiguration(configuration *config.Configuration)
- func (s *BookingRepository) SetCtx(ctx *context.Context)
- func (s *BookingRepository) SetLogger(logger *logger.LocalLogger)
- type ChannelBindingRepository
- func (s *ChannelBindingRepository) Client() *channels.ChannelsClient
- func (s *ChannelBindingRepository) Configuration() *config.Configuration
- func (s *ChannelBindingRepository) Ctx() *context.Context
- func (s *ChannelBindingRepository) Execute() error
- func (s *ChannelBindingRepository) Logger() *logger.LocalLogger
- func (s *ChannelBindingRepository) Name() string
- func (s *ChannelBindingRepository) SetClient(client *channels.ChannelsClient)
- func (s *ChannelBindingRepository) SetConfiguration(configuration *config.Configuration)
- func (s *ChannelBindingRepository) SetCtx(ctx *context.Context)
- func (s *ChannelBindingRepository) SetLogger(logger *logger.LocalLogger)
- type EntityRepository
- type HoldRepository
- func (s *HoldRepository) ChannelsClient() *channels.ChannelsClient
- func (s *HoldRepository) Client() *booking.BookingClient
- func (s *HoldRepository) Configuration() *config.Configuration
- func (s *HoldRepository) Ctx() *context.Context
- func (s *HoldRepository) Execute() error
- func (s *HoldRepository) Logger() *logger.LocalLogger
- func (s *HoldRepository) Name() string
- func (s *HoldRepository) SetChannelsClient(channelClient *channels.ChannelsClient)
- func (s *HoldRepository) SetClient(client *booking.BookingClient)
- func (s *HoldRepository) SetConfiguration(configuration *config.Configuration)
- func (s *HoldRepository) SetCtx(ctx *context.Context)
- func (s *HoldRepository) SetLogger(logger *logger.LocalLogger)
- type ProductRepository
- func (p *ProductRepository) Client() *channels.ChannelsClient
- func (p *ProductRepository) Configuration() *config.Configuration
- func (p *ProductRepository) Ctx() *context.Context
- func (p *ProductRepository) Execute() error
- func (p *ProductRepository) Logger() *logger.LocalLogger
- func (p *ProductRepository) Name() string
- func (p *ProductRepository) SetClient(client *channels.ChannelsClient)
- func (p *ProductRepository) SetConfiguration(configuration *config.Configuration)
- func (p *ProductRepository) SetCtx(ctx *context.Context)
- func (p *ProductRepository) SetLogger(logger *logger.LocalLogger)
- type RateRepository
- func (s *RateRepository) Client() *channels.ChannelsClient
- func (s *RateRepository) Configuration() *config.Configuration
- func (s *RateRepository) Ctx() *context.Context
- func (s *RateRepository) Execute() error
- func (s *RateRepository) Logger() *logger.LocalLogger
- func (s *RateRepository) Name() string
- func (s *RateRepository) SetClient(client *channels.ChannelsClient)
- func (s *RateRepository) SetConfiguration(configuration *config.Configuration)
- func (s *RateRepository) SetCtx(ctx *context.Context)
- func (s *RateRepository) SetLogger(logger *logger.LocalLogger)
- type SupplierRepository
- func (s *SupplierRepository) Client() *channels.ChannelsClient
- func (s *SupplierRepository) Configuration() *config.Configuration
- func (s *SupplierRepository) Ctx() *context.Context
- func (s *SupplierRepository) Execute() error
- func (s *SupplierRepository) Logger() *logger.LocalLogger
- func (s *SupplierRepository) Name() string
- func (s *SupplierRepository) SetClient(client *channels.ChannelsClient)
- func (s *SupplierRepository) SetConfiguration(configuration *config.Configuration)
- func (s *SupplierRepository) SetCtx(ctx *context.Context)
- func (s *SupplierRepository) SetLogger(logger *logger.LocalLogger)
Constants ¶
const (
BookingCommandName = "booking"
)
const (
ChannelBindingCommandName = "channelBinding"
)
const (
HoldCommandName = "hold"
)
const (
ProductCommandName = "product"
)
const (
RateCommandName = "rate"
)
const (
SupplierCommandName = "supplier"
)
Variables ¶
var ( RootCmd = cobra.Command{ Use: "channels_booking_clients", Short: "channel booking generator", Long: "channel booking generator", SilenceUsage: true, } Version string Commit string Date string )
var (
ErrorBookingFileIsNotFound = errors.New("booking.json file was not found by path")
)
var (
ErrorChannelBindingFileIsNotFound = errors.New("channelBinding.json file was not found by path")
)
var (
ErrorHoldFileIsNotFound = errors.New("hold.json file was not found by path")
)
var (
ErrorProductFileIsNotFound = errors.New("product.json file was not found by path")
)
var (
ErrorRateFileIsNotFound = errors.New("rate.json file was not found by path")
)
var (
ErrorStopAfterEntityIsUnknown = errors.New("value of stopAfterEntity is unknown")
)
var (
ErrorSupplierFileIsNotFound = errors.New("supplier.json file was not found by path")
)
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 ¶
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 (s *BookingRepository) Client() *booking.BookingClient
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 (s *ChannelBindingRepository) Client() *channels.ChannelsClient
func (*ChannelBindingRepository) Configuration ¶
func (s *ChannelBindingRepository) Configuration() *config.Configuration
func (*ChannelBindingRepository) Ctx ¶
func (s *ChannelBindingRepository) Ctx() *context.Context
func (*ChannelBindingRepository) Execute ¶
func (s *ChannelBindingRepository) Execute() error
Execute represents the supplier command
func (*ChannelBindingRepository) Logger ¶
func (s *ChannelBindingRepository) Logger() *logger.LocalLogger
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 (p *ProductRepository) Client() *channels.ChannelsClient
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 (s *SupplierRepository) Client() *channels.ChannelsClient
func (*SupplierRepository) Configuration ¶
func (s *SupplierRepository) Configuration() *config.Configuration
func (*SupplierRepository) Ctx ¶
func (s *SupplierRepository) Ctx() *context.Context
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)