client

package
v0.11.0 Latest Latest
Warning

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

Go to latest
Published: Oct 18, 2021 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	TableName = "clients"
)

Functions

This section is empty.

Types

type Client

type Client struct {
	ID        uint           `json:"id" gorm:"primarykey"`
	CreatedAt time.Time      `json:"created_at"`
	UpdatedAt time.Time      `json:"updated_at"`
	DeletedAt gorm.DeletedAt `json:"deleted_at" gorm:"index"`

	Name        string `json:"name"`
	Description string `json:"description"`
	Email       string `json:"email"`
	Phone       string `json:"phone"`
	Social      Social `gorm:"embedded;embeddedPrefix:social_" mapstructure:",squash"`
	// contains filtered or unexported fields
}

func New added in v0.10.0

func New(path string) *Client

func (*Client) Delete

func (c *Client) Delete(name string) error

func (*Client) FindByName added in v0.10.0

func (c *Client) FindByName(query string, limit int) ([]Client, error)

func (*Client) GetByID added in v0.7.7

func (c *Client) GetByID(id int) (*Client, error)

func (*Client) List added in v0.7.8

func (c *Client) List() ([]Client, error)

func (*Client) Save

func (c *Client) Save() error

func (*Client) SaveJSON added in v0.10.0

func (c *Client) SaveJSON(payload map[string]interface{}) error

func (*Client) Update added in v0.10.0

func (c *Client) Update(payload map[string]interface{}) error

func (*Client) With

func (c *Client) With(name, description, email, phone string) *Client

type Social added in v0.10.0

type Social struct {
	Website   string `json:"website" mapstructure:"social_website"`
	Instagram string `json:"instagram" mapstructure:"social_instagram"`
	Twitter   string `json:"twitter"  mapstructure:"social_twitter"`
	Facebook  string `json:"facebook"  mapstructure:"social_facebook"`
	Linkedin  string `json:"linkedin"  mapstructure:"social_linkedin"`
}

Jump to

Keyboard shortcuts

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