MCPcopy
hub / github.com/benbjohnson/wtf / DialMembershipService

Interface DialMembershipService

dial_membership.go:65–89  ·  view source on GitHub ↗

DialMembershipService represents a service for managing dial memberships.

Source from the content-addressed store, hash-verified

63
64// DialMembershipService represents a service for managing dial memberships.
65type DialMembershipService interface {
66 // Retrieves a membership by ID along with the associated dial & user.
67 // Returns ENOTFOUND if membership does exist or user does not have
68 // permission to view it.
69 FindDialMembershipByID(ctx context.Context, id int) (*DialMembership, error)
70
71 // Retrieves a list of matching memberships based on filter. Only returns
72 // memberships that belong to dials that the current user is a member of.
73 // Also returns a count of total matching memberships which may different if
74 // "Limit" is specified on the filter.
75 FindDialMemberships(ctx context.Context, filter DialMembershipFilter) ([]*DialMembership, int, error)
76
77 // Creates a new membership on a dial for the current user. Returns
78 // EUNAUTHORIZED if there is no current user logged in.
79 CreateDialMembership(ctx context.Context, membership *DialMembership) error
80
81 // Updates the value of a membership. Only the owner of the membership can
82 // update the value. Returns EUNAUTHORIZED if user is not the owner. Returns
83 // ENOTFOUND if the membership does not exist.
84 UpdateDialMembership(ctx context.Context, id int, upd DialMembershipUpdate) (*DialMembership, error)
85
86 // Permanently deletes a membership by ID. Only the membership owner and
87 // the parent dial's owner can delete a membership.
88 DeleteDialMembership(ctx context.Context, id int) error
89}
90
91// Dial membership sort options. Only specific sorting options are supported.
92const (

Implementers 2

DialMembershipServicemock/dial_membership.go
DialMembershipServicesqlite/dial_membership.go

Calls

no outgoing calls

Tested by

no test coverage detected