profile

package
v7.0.0-rc1+incompatible Latest Latest
Warning

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

Go to latest
Published: Jul 20, 2022 License: Apache-2.0, BSD-2-Clause, BSD-3-Clause, + 1 more Imports: 20 Imported by: 0

Documentation

Overview

Package profile includes logic and handlers for Profile-related API endpoints, including /profiles, /profiles/name/{{name}}/parameters, /profiles/{{ID}}/parameters, /profiles/name/{{New Profile Name}}/copy/{{existing Profile Name}}, /profiles/import, and /profiles/{{ID}}/export.

Index

Constants

View Source
const (
	CDNQueryParam         = "cdn"
	DescriptionQueryParam = "description"
	IDQueryParam          = "id"
	NameQueryParam        = "name"
	ParamQueryParam       = "param"
	TypeQueryParam        = "type"
)

Supported (non-pagination) query string parameters for /profiles.

Variables

This section is empty.

Functions

func CopyProfileHandler

func CopyProfileHandler(w http.ResponseWriter, r *http.Request)

CopyProfileHandler creates a new profile and parameters from an existing profile.

func ExportProfileHandler

func ExportProfileHandler(w http.ResponseWriter, r *http.Request)

ExportProfileHandler exports a profile per ID

func ImportProfileHandler

func ImportProfileHandler(w http.ResponseWriter, r *http.Request)

ImportProfileHandler handles importing profile

func ReadParameters

func ReadParameters(tx *sqlx.Tx, parameters map[string]string, user *auth.CurrentUser, profile tc.ProfileNullable) ([]tc.ParameterNullable, error)

Types

type TOProfile

type TOProfile struct {
	api.APIInfoImpl `json:"-"`
	tc.ProfileNullable
}

we need a type alias to define functions on

func (*TOProfile) Create

func (pr *TOProfile) Create() (error, error, int)

func (*TOProfile) Delete

func (pr *TOProfile) Delete() (error, error, int)

func (*TOProfile) DeleteQuery

func (v *TOProfile) DeleteQuery() string

func (*TOProfile) GetAuditName

func (prof *TOProfile) GetAuditName() string

func (TOProfile) GetKeyFieldsInfo

func (prof TOProfile) GetKeyFieldsInfo() []api.KeyFieldInfo

func (TOProfile) GetKeys

func (prof TOProfile) GetKeys() (map[string]interface{}, bool)

Implementation of the Identifier, Validator interface functions

func (*TOProfile) GetLastUpdated

func (v *TOProfile) GetLastUpdated() (*time.Time, bool, error)

func (*TOProfile) GetType

func (prof *TOProfile) GetType() string

func (*TOProfile) InsertQuery

func (v *TOProfile) InsertQuery() string

func (*TOProfile) Read

func (prof *TOProfile) Read(h http.Header, useIMS bool) ([]interface{}, error, error, int, *time.Time)

func (*TOProfile) SetKeys

func (prof *TOProfile) SetKeys(keys map[string]interface{})

func (*TOProfile) SetLastUpdated

func (v *TOProfile) SetLastUpdated(t tc.TimeNoMod)

func (*TOProfile) Update

func (pr *TOProfile) Update(h http.Header) (error, error, int)

func (*TOProfile) UpdateQuery

func (v *TOProfile) UpdateQuery() string

func (*TOProfile) Validate

func (prof *TOProfile) Validate() (error, error)

Jump to

Keyboard shortcuts

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