settings

package
v0.12.6 Latest Latest
Warning

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

Go to latest
Published: Oct 31, 2022 License: MIT Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetSettingsPB

func GetSettingsPB(settingsDB *Model) (*settings.Settings, error)

GetSettingsPB converts settings model to protobuf message

func NewSettingsAPI

func NewSettingsAPI(ctx context.Context, opt *Options) (settings.SettingsAPIServer, error)

NewSettingsAPI creates a new instance of settings API server

func ValidateSetting

func ValidateSetting(settingPB *settings.Setting) error

ValidateSetting validates a setitng resource

Types

type Model

type Model struct {
	OwnerID   uint   `gorm:"primarykey"`
	Settings  []byte `gorm:"type:json"`
	CreatedAt time.Time
	UpdatedAt time.Time
	DeletedAt gorm.DeletedAt `gorm:"index"`
}

Model for settings

func GetSettingsDB

func GetSettingsDB(settingsPB *settings.Settings) (*Model, error)

GetSettingsDB converts settings model to protobuf settings

func (*Model) TableName

func (*Model) TableName() string

TableName is table that stores user settings

type Options

type Options struct {
	SQLDB         *gorm.DB
	Logger        grpclog.LoggerV2
	API           auth.API
	JWTSigningKey []byte
}

Options contains parameters passed to NewOperationAPIService

Jump to

Keyboard shortcuts

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