projects

package
v0.0.0-...-678ecff Latest Latest
Warning

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

Go to latest
Published: Sep 18, 2019 License: AGPL-3.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ProjectInfoResponse

type ProjectInfoResponse struct {
	ID            string                `json:"id"`
	Slug          string                `json:"slug"`
	Name          string                `json:"name"`
	Summary       string                `json:"summary"`
	About         string                `json:"about"`
	Website       string                `json:"website"`
	License       string                `json:"license"`
	Repository    string                `json:"repository"`
	RootBudget    string                `json:"budget_root"`
	Balance       int64                 `json:"balance"`
	ProcessingCut int64                 `json:"processing_cut"`
	Contributors  []contributorResponse `json:"contributors,omitempty"`
	Activated     bool                  `json:"activated"`
}

func PrepareProjectResponse

func PrepareProjectResponse(context smolder.APIContext, project *db.Project) ProjectInfoResponse

type ProjectPostStruct

type ProjectPostStruct struct {
	Project struct {
		Slug           string `json:"slug"`
		Name           string `json:"name"`
		Summary        string `json:"summary"`
		About          string `json:"about"`
		Website        string `json:"website"`
		License        string `json:"license"`
		Repository     string `json:"repository"`
		Logo           string `json:"logo"`
		Private        bool   `json:"private"`
		PrivateBalance bool   `json:"private_balance"`
	} `json:"project"`
}

ProjectPostStruct holds all values of an incoming POST request

type ProjectPutStruct

type ProjectPutStruct struct {
	ProjectPostStruct
}

ProjectPutStruct holds all values of an incoming PUT request

type ProjectResource

type ProjectResource struct {
	smolder.Resource
}

ProjectResource is the resource responsible for /projects

func (*ProjectResource) Get

func (r *ProjectResource) Get(context smolder.APIContext, request *restful.Request, response *restful.Response, params map[string][]string)

Get sends out items matching the query parameters

func (*ProjectResource) GetAuthRequired

func (r *ProjectResource) GetAuthRequired() bool

GetAuthRequired returns true because all requests need authentication

func (*ProjectResource) GetByIDs

func (r *ProjectResource) GetByIDs(context smolder.APIContext, request *restful.Request, response *restful.Response, ids []string)

GetByIDs sends out all items matching a set of IDs

func (*ProjectResource) GetByIDsAuthRequired

func (r *ProjectResource) GetByIDsAuthRequired() bool

GetByIDsAuthRequired returns true because all requests need authentication

func (*ProjectResource) GetDoc

func (r *ProjectResource) GetDoc() string

GetDoc returns the description of this API endpoint

func (*ProjectResource) GetParams

func (r *ProjectResource) GetParams() []*restful.Parameter

GetParams returns the parameters supported by this API endpoint

func (*ProjectResource) Post

func (r *ProjectResource) Post(context smolder.APIContext, data interface{}, request *restful.Request, response *restful.Response)

Post processes an incoming POST (create) request

func (*ProjectResource) PostAuthRequired

func (r *ProjectResource) PostAuthRequired() bool

PostAuthRequired returns true because all requests need authentication

func (*ProjectResource) PostDoc

func (r *ProjectResource) PostDoc() string

PostDoc returns the description of this API endpoint

func (*ProjectResource) PostParams

func (r *ProjectResource) PostParams() []*restful.Parameter

PostParams returns the parameters supported by this API endpoint

func (*ProjectResource) Put

func (r *ProjectResource) Put(context smolder.APIContext, data interface{}, request *restful.Request, response *restful.Response)

Put processes an incoming PUT (update) request

func (*ProjectResource) PutAuthRequired

func (r *ProjectResource) PutAuthRequired() bool

PutAuthRequired returns true because all requests need authentication

func (*ProjectResource) PutDoc

func (r *ProjectResource) PutDoc() string

PutDoc returns the description of this API endpoint

func (*ProjectResource) PutParams

func (r *ProjectResource) PutParams() []*restful.Parameter

PutParams returns the parameters supported by this API endpoint

func (*ProjectResource) Reads

func (r *ProjectResource) Reads() interface{}

Reads returns the model that will be read by POST, PUT & PATCH operations

func (*ProjectResource) Register

func (r *ProjectResource) Register(container *restful.Container, config smolder.APIConfig, context smolder.APIContextFactory)

Register this resource with the container to setup all the routes

func (*ProjectResource) Returns

func (r *ProjectResource) Returns() interface{}

Returns returns the model that will be returned

func (*ProjectResource) Validate

func (r *ProjectResource) Validate(context smolder.APIContext, data interface{}, request *restful.Request) error

Validate checks an incoming request for data errors

type ProjectResponse

type ProjectResponse struct {
	smolder.Response

	Projects []ProjectInfoResponse `json:"projects,omitempty"`
	// contains filtered or unexported fields
}

ProjectResponse is the common response to 'project' requests

func (*ProjectResponse) AddProject

func (r *ProjectResponse) AddProject(project *db.Project)

AddProject adds a project to the response

func (*ProjectResponse) EmptyResponse

func (r *ProjectResponse) EmptyResponse() interface{}

EmptyResponse returns an empty API response for this endpoint if there's no data to respond with

func (*ProjectResponse) Init

func (r *ProjectResponse) Init(context smolder.APIContext)

Init a new response

Jump to

Keyboard shortcuts

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