aboutsummaryrefslogtreecommitdiff
path: root/site.go
blob: 892a6e5f2e8611f3e97bd17f9b39f3adfdd7be60 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
package sws

import (
	"fmt"
	"time"
)

const slugSalt = "saltyslugs"

type Site struct {
	ID          *int    `json:"id,omitempty"`
	Name        *string `json:"name,omitempty"`
	Description string  `json:"description,omitempty"`
	Aliases     *string `json:"aliases,omitempty"`
	Enabled     bool    `json:"enabled"`
	//ExcludePaths []string
	CreatedAt *time.Time `json:"created_at,omitempty" db:"created_at"`
	UpdatedAt *time.Time `json:"updated_at,omitempty" db:"updated_at"`
}

func (d *Site) Validate() []error {
	var out []error
	if d.Name == nil {
		out = append(out, fmt.Errorf("missing name"))
	}
	return out
}