notes

package
v0.0.0-...-b9360c4 Latest Latest
Warning

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

Go to latest
Published: Dec 15, 2023 License: BSD-3-Clause Imports: 5 Imported by: 0

Documentation

Index

Constants

View Source
const ServiceName = "notes"

ServiceName is the name of the service as defined in the design. This is the same value that is set in the endpoint request contexts under the ServiceKey key.

Variables

View Source
var MethodNames = [5]string{"update", "get", "download media", "upload media", "delete media"}

MethodNames lists the service method names as defined in the design. These are the same values that are set in the endpoint request contexts under the MethodKey key.

Functions

func MakeBadRequest

func MakeBadRequest(err error) *goa.ServiceError

MakeBadRequest builds a goa.ServiceError from an error.

func MakeForbidden

func MakeForbidden(err error) *goa.ServiceError

MakeForbidden builds a goa.ServiceError from an error.

func MakeNotFound

func MakeNotFound(err error) *goa.ServiceError

MakeNotFound builds a goa.ServiceError from an error.

func MakeUnauthorized

func MakeUnauthorized(err error) *goa.ServiceError

MakeUnauthorized builds a goa.ServiceError from an error.

func NewDeleteMediaEndpoint

func NewDeleteMediaEndpoint(s Service, authJWTFn security.AuthJWTFunc) goa.Endpoint

NewDeleteMediaEndpoint returns an endpoint function that calls the method "delete media" of service "notes".

func NewDownloadMediaEndpoint

func NewDownloadMediaEndpoint(s Service, authJWTFn security.AuthJWTFunc) goa.Endpoint

NewDownloadMediaEndpoint returns an endpoint function that calls the method "download media" of service "notes".

func NewGetEndpoint

func NewGetEndpoint(s Service, authJWTFn security.AuthJWTFunc) goa.Endpoint

NewGetEndpoint returns an endpoint function that calls the method "get" of service "notes".

func NewUpdateEndpoint

func NewUpdateEndpoint(s Service, authJWTFn security.AuthJWTFunc) goa.Endpoint

NewUpdateEndpoint returns an endpoint function that calls the method "update" of service "notes".

func NewUploadMediaEndpoint

func NewUploadMediaEndpoint(s Service, authJWTFn security.AuthJWTFunc) goa.Endpoint

NewUploadMediaEndpoint returns an endpoint function that calls the method "upload media" of service "notes".

func NewViewedFieldNotes

func NewViewedFieldNotes(res *FieldNotes, view string) *notesviews.FieldNotes

NewViewedFieldNotes initializes viewed result type FieldNotes from result type FieldNotes using the given view.

func NewViewedNoteMedia

func NewViewedNoteMedia(res *NoteMedia, view string) *notesviews.NoteMedia

NewViewedNoteMedia initializes viewed result type NoteMedia from result type NoteMedia using the given view.

Types

type Auther

type Auther interface {
	// JWTAuth implements the authorization logic for the JWT security scheme.
	JWTAuth(ctx context.Context, token string, schema *security.JWTScheme) (context.Context, error)
}

Auther defines the authorization functions to be implemented by the service.

type Client

type Client struct {
	UpdateEndpoint        goa.Endpoint
	GetEndpoint           goa.Endpoint
	DownloadMediaEndpoint goa.Endpoint
	UploadMediaEndpoint   goa.Endpoint
	DeleteMediaEndpoint   goa.Endpoint
}

Client is the "notes" service client.

func NewClient

func NewClient(update, get, downloadMedia, uploadMedia, deleteMedia goa.Endpoint) *Client

NewClient initializes a "notes" service client given the endpoints.

func (*Client) DeleteMedia

func (c *Client) DeleteMedia(ctx context.Context, p *DeleteMediaPayload) (err error)

DeleteMedia calls the "delete media" endpoint of the "notes" service.

func (*Client) DownloadMedia

func (c *Client) DownloadMedia(ctx context.Context, p *DownloadMediaPayload) (res *DownloadMediaResult, resp io.ReadCloser, err error)

DownloadMedia calls the "download media" endpoint of the "notes" service.

func (*Client) Get

func (c *Client) Get(ctx context.Context, p *GetPayload) (res *FieldNotes, err error)

Get calls the "get" endpoint of the "notes" service.

func (*Client) Update

func (c *Client) Update(ctx context.Context, p *UpdatePayload) (res *FieldNotes, err error)

Update calls the "update" endpoint of the "notes" service.

func (*Client) UploadMedia

func (c *Client) UploadMedia(ctx context.Context, p *UploadMediaPayload, req io.ReadCloser) (res *NoteMedia, err error)

UploadMedia calls the "upload media" endpoint of the "notes" service.

type DeleteMediaPayload

type DeleteMediaPayload struct {
	Auth    string
	MediaID int32
}

DeleteMediaPayload is the payload type of the notes service delete media method.

type DownloadMediaPayload

type DownloadMediaPayload struct {
	Auth    *string
	MediaID int32
}

DownloadMediaPayload is the payload type of the notes service download media method.

type DownloadMediaResponseData

type DownloadMediaResponseData struct {
	// Result is the method result.
	Result *DownloadMediaResult
	// Body streams the HTTP response body.
	Body io.ReadCloser
}

DownloadMediaResponseData holds both the result and the HTTP response body reader of the "download media" method.

type DownloadMediaResult

type DownloadMediaResult struct {
	Length      int64
	ContentType string
}

DownloadMediaResult is the result type of the notes service download media method.

type Endpoints

type Endpoints struct {
	Update        goa.Endpoint
	Get           goa.Endpoint
	DownloadMedia goa.Endpoint
	UploadMedia   goa.Endpoint
	DeleteMedia   goa.Endpoint
}

Endpoints wraps the "notes" service endpoints.

func NewEndpoints

func NewEndpoints(s Service) *Endpoints

NewEndpoints wraps the methods of the "notes" service with endpoints.

func (*Endpoints) Use

func (e *Endpoints) Use(m func(goa.Endpoint) goa.Endpoint)

Use applies the given middleware to all the "notes" service endpoints.

type ExistingFieldNote

type ExistingFieldNote struct {
	ID       int64
	Key      *string
	Title    *string
	Body     *string
	MediaIds []int64
}

type FieldNote

type FieldNote struct {
	ID        int64
	CreatedAt int64
	UpdatedAt int64
	Author    *FieldNoteAuthor
	Key       *string
	Title     *string
	Body      *string
	Version   int64
	Media     []*NoteMedia
}

type FieldNoteAuthor

type FieldNoteAuthor struct {
	ID       int32
	Name     string
	MediaURL string
}

type FieldNoteStation

type FieldNoteStation struct {
	ReadOnly bool
}

type FieldNoteUpdate

type FieldNoteUpdate struct {
	Notes    []*ExistingFieldNote
	Creating []*NewFieldNote
}

type FieldNotes

type FieldNotes struct {
	Notes   []*FieldNote
	Media   []*NoteMedia
	Station *FieldNoteStation
}

FieldNotes is the result type of the notes service update method.

func NewFieldNotes

func NewFieldNotes(vres *notesviews.FieldNotes) *FieldNotes

NewFieldNotes initializes result type FieldNotes from viewed result type FieldNotes.

type GetPayload

type GetPayload struct {
	Auth      *string
	StationID int32
}

GetPayload is the payload type of the notes service get method.

type NewFieldNote

type NewFieldNote struct {
	Key      *string
	Title    *string
	Body     *string
	MediaIds []int64
}

type NoteMedia

type NoteMedia struct {
	ID          int64
	URL         string
	Key         string
	ContentType string
}

NoteMedia is the result type of the notes service upload media method.

func NewNoteMedia

func NewNoteMedia(vres *notesviews.NoteMedia) *NoteMedia

NewNoteMedia initializes result type NoteMedia from viewed result type NoteMedia.

type Service

type Service interface {
	// Update implements update.
	Update(context.Context, *UpdatePayload) (res *FieldNotes, err error)
	// Get implements get.
	Get(context.Context, *GetPayload) (res *FieldNotes, err error)
	// DownloadMedia implements download media.
	DownloadMedia(context.Context, *DownloadMediaPayload) (res *DownloadMediaResult, body io.ReadCloser, err error)
	// UploadMedia implements upload media.
	UploadMedia(context.Context, *UploadMediaPayload, io.ReadCloser) (res *NoteMedia, err error)
	// DeleteMedia implements delete media.
	DeleteMedia(context.Context, *DeleteMediaPayload) (err error)
}

Service is the notes service interface.

type UpdatePayload

type UpdatePayload struct {
	Auth      string
	StationID int32
	Notes     *FieldNoteUpdate
}

UpdatePayload is the payload type of the notes service update method.

type UploadMediaPayload

type UploadMediaPayload struct {
	Auth          string
	ContentLength int64
	ContentType   string
	StationID     int32
	Key           string
}

UploadMediaPayload is the payload type of the notes service upload media method.

type UploadMediaRequestData

type UploadMediaRequestData struct {
	// Payload is the method payload.
	Payload *UploadMediaPayload
	// Body streams the HTTP request body.
	Body io.ReadCloser
}

UploadMediaRequestData holds both the payload and the HTTP request body reader of the "upload media" method.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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