stationnote

package
v0.0.0-...-d2cf98a Latest Latest
Warning

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

Go to latest
Published: Oct 22, 2024 License: BSD-3-Clause Imports: 4 Imported by: 0

Documentation

Index

Constants

View Source
const ServiceName = "station_note"

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 = [4]string{"station", "add note", "update note", "delete note"}

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 NewAddNoteEndpoint

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

NewAddNoteEndpoint returns an endpoint function that calls the method "add note" of service "station_note".

func NewDeleteNoteEndpoint

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

NewDeleteNoteEndpoint returns an endpoint function that calls the method "delete note" of service "station_note".

func NewStationEndpoint

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

NewStationEndpoint returns an endpoint function that calls the method "station" of service "station_note".

func NewUpdateNoteEndpoint

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

NewUpdateNoteEndpoint returns an endpoint function that calls the method "update note" of service "station_note".

func NewViewedStationNote

func NewViewedStationNote(res *StationNote, view string) *stationnoteviews.StationNote

NewViewedStationNote initializes viewed result type StationNote from result type StationNote using the given view.

func NewViewedStationNotes

func NewViewedStationNotes(res *StationNotes, view string) *stationnoteviews.StationNotes

NewViewedStationNotes initializes viewed result type StationNotes from result type StationNotes using the given view.

Types

type AddNotePayload

type AddNotePayload struct {
	Auth      string
	UserID    int32
	Body      string
	StationID int32
}

AddNotePayload is the payload type of the station_note service add note method.

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 {
	StationEndpoint    goa.Endpoint
	AddNoteEndpoint    goa.Endpoint
	UpdateNoteEndpoint goa.Endpoint
	DeleteNoteEndpoint goa.Endpoint
}

Client is the "station_note" service client.

func NewClient

func NewClient(station, addNote, updateNote, deleteNote goa.Endpoint) *Client

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

func (*Client) AddNote

func (c *Client) AddNote(ctx context.Context, p *AddNotePayload) (res *StationNote, err error)

AddNote calls the "add note" endpoint of the "station_note" service.

func (*Client) DeleteNote

func (c *Client) DeleteNote(ctx context.Context, p *DeleteNotePayload) (err error)

DeleteNote calls the "delete note" endpoint of the "station_note" service.

func (*Client) Station

func (c *Client) Station(ctx context.Context, p *StationPayload) (res *StationNotes, err error)

Station calls the "station" endpoint of the "station_note" service.

func (*Client) UpdateNote

func (c *Client) UpdateNote(ctx context.Context, p *UpdateNotePayload) (res *StationNote, err error)

UpdateNote calls the "update note" endpoint of the "station_note" service.

type DeleteNotePayload

type DeleteNotePayload struct {
	Auth          string
	StationID     int32
	StationNoteID int32
}

DeleteNotePayload is the payload type of the station_note service delete note method.

type Endpoints

type Endpoints struct {
	Station    goa.Endpoint
	AddNote    goa.Endpoint
	UpdateNote goa.Endpoint
	DeleteNote goa.Endpoint
}

Endpoints wraps the "station_note" service endpoints.

func NewEndpoints

func NewEndpoints(s Service) *Endpoints

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

func (*Endpoints) Use

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

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

type Service

type Service interface {
	// Station implements station.
	Station(context.Context, *StationPayload) (res *StationNotes, err error)
	// AddNote implements add note.
	AddNote(context.Context, *AddNotePayload) (res *StationNote, err error)
	// UpdateNote implements update note.
	UpdateNote(context.Context, *UpdateNotePayload) (res *StationNote, err error)
	// DeleteNote implements delete note.
	DeleteNote(context.Context, *DeleteNotePayload) (err error)
}

Service is the station_note service interface.

type StationNote

type StationNote struct {
	ID        int32
	CreatedAt int64
	UpdatedAt int64
	Author    *StationNoteAuthor
	Body      string
}

StationNote is the result type of the station_note service add note method.

func NewStationNote

func NewStationNote(vres *stationnoteviews.StationNote) *StationNote

NewStationNote initializes result type StationNote from viewed result type StationNote.

type StationNoteAuthor

type StationNoteAuthor struct {
	ID    int32
	Name  string
	Photo *StationNoteAuthorPhoto
}

type StationNoteAuthorPhoto

type StationNoteAuthorPhoto struct {
	URL string
}

type StationNotes

type StationNotes struct {
	Notes []*StationNote
}

StationNotes is the result type of the station_note service station method.

func NewStationNotes

func NewStationNotes(vres *stationnoteviews.StationNotes) *StationNotes

NewStationNotes initializes result type StationNotes from viewed result type StationNotes.

type StationPayload

type StationPayload struct {
	Auth      *string
	StationID int32
}

StationPayload is the payload type of the station_note service station method.

type UpdateNotePayload

type UpdateNotePayload struct {
	Auth          string
	StationID     int32
	StationNoteID int32
	Body          string
}

UpdateNotePayload is the payload type of the station_note service update note method.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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