config

package
v0.0.0-...-9a5c20e Latest Latest
Warning

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

Go to latest
Published: May 2, 2024 License: BSD-3-Clause Imports: 4 Imported by: 1

README

config

import "github.com/blueprint-uservices/blueprint/examples/train_ticket/workflow/config"

package config implements ts-config-service from the train ticket application

Index

type Config

type Config struct {
    Name        string
    Value       string
    Description string
}

type ConfigService

Config Service manages Config variables in the application

type ConfigService interface {
    // Creates a new config variable
    Create(ctx context.Context, conf Config) error
    // Updates an existing `conf` config variable
    Update(ctx context.Context, conf Config) (bool, error)
    // Find a config variable using its `name`
    Find(ctx context.Context, name string) (Config, error)
    // Deletes an existing config variable using its `name`
    Delete(ctx context.Context, name string) error
    // Find all config variables
    FindAll(ctx context.Context) ([]Config, error)
}

type ConfigServiceImpl

Implementation of Config Service

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

func NewConfigServiceImpl
func NewConfigServiceImpl(ctx context.Context, db backend.NoSQLDatabase) (*ConfigServiceImpl, error)

Creates a new ConfigService object

func (*ConfigServiceImpl) Create
func (c *ConfigServiceImpl) Create(ctx context.Context, conf Config) error

func (*ConfigServiceImpl) Delete
func (c *ConfigServiceImpl) Delete(ctx context.Context, name string) error

func (*ConfigServiceImpl) Find
func (c *ConfigServiceImpl) Find(ctx context.Context, name string) (Config, error)

func (*ConfigServiceImpl) FindAll
func (c *ConfigServiceImpl) FindAll(ctx context.Context) ([]Config, error)

func (*ConfigServiceImpl) Update
func (c *ConfigServiceImpl) Update(ctx context.Context, conf Config) (bool, error)

Generated by gomarkdoc

Documentation

Overview

package config implements ts-config-service from the train ticket application

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	Name        string
	Value       string
	Description string
}

type ConfigService

type ConfigService interface {
	// Creates a new config variable
	Create(ctx context.Context, conf Config) error
	// Updates an existing `conf` config variable
	Update(ctx context.Context, conf Config) (bool, error)
	// Find a config variable using its `name`
	Find(ctx context.Context, name string) (Config, error)
	// Deletes an existing config variable using its `name`
	Delete(ctx context.Context, name string) error
	// Find all config variables
	FindAll(ctx context.Context) ([]Config, error)
}

Config Service manages Config variables in the application

type ConfigServiceImpl

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

Implementation of Config Service

func NewConfigServiceImpl

func NewConfigServiceImpl(ctx context.Context, db backend.NoSQLDatabase) (*ConfigServiceImpl, error)

Creates a new ConfigService object

func (*ConfigServiceImpl) Create

func (c *ConfigServiceImpl) Create(ctx context.Context, conf Config) error

func (*ConfigServiceImpl) Delete

func (c *ConfigServiceImpl) Delete(ctx context.Context, name string) error

func (*ConfigServiceImpl) Find

func (c *ConfigServiceImpl) Find(ctx context.Context, name string) (Config, error)

func (*ConfigServiceImpl) FindAll

func (c *ConfigServiceImpl) FindAll(ctx context.Context) ([]Config, error)

func (*ConfigServiceImpl) Update

func (c *ConfigServiceImpl) Update(ctx context.Context, conf Config) (bool, error)

Jump to

Keyboard shortcuts

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