mirror of
https://github.com/hexolan/panels.git
synced 2026-03-26 12:40:21 +00:00
style: license headers + gofmt
This commit is contained in:
@@ -1,3 +1,17 @@
|
||||
// Copyright 2023 Declan Teevan
|
||||
//
|
||||
// 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.
|
||||
|
||||
package internal
|
||||
|
||||
import (
|
||||
@@ -13,9 +27,9 @@ import (
|
||||
type Panel struct {
|
||||
Id int64 `json:"id"`
|
||||
|
||||
Name string `json:"name"`
|
||||
Name string `json:"name"`
|
||||
Description string `json:"description"`
|
||||
|
||||
|
||||
CreatedAt pgtype.Timestamp `json:"created_at"`
|
||||
UpdatedAt pgtype.Timestamp `json:"updated_at"`
|
||||
}
|
||||
@@ -34,7 +48,7 @@ func DestringifyPanelId(reprId string) (int64, error) {
|
||||
|
||||
// Model for creating panels
|
||||
type PanelCreate struct {
|
||||
Name string `json:"name"`
|
||||
Name string `json:"name"`
|
||||
Description string `json:"description"`
|
||||
}
|
||||
|
||||
@@ -48,7 +62,7 @@ func (p *PanelCreate) Validate() error {
|
||||
|
||||
// Model for updating a panel
|
||||
type PanelUpdate struct {
|
||||
Name *string `json:"name,omitempty"`
|
||||
Name *string `json:"name,omitempty"`
|
||||
Description *string `json:"description,omitempty"`
|
||||
}
|
||||
|
||||
@@ -75,4 +89,4 @@ type PanelRepository interface {
|
||||
GetPanelIdFromName(ctx context.Context, name string) (*int64, error)
|
||||
UpdatePanel(ctx context.Context, id int64, data PanelUpdate) (*Panel, error)
|
||||
DeletePanel(ctx context.Context, id int64) error
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user